
/* 主要色彩变量定义 */
:root {
  --primary-color: #1E3A8A; /* 深蓝色，传递稳重与专业 */
  --accent-green: #10B981;  /* 绿色，用于强调交互元素 */
  --accent-orange: #F59E0B; /* 橙色，用于突出重要信息 */
  --background-gradient: linear-gradient(to bottom, #F3F4F6, #374151); /* 灰白渐变背景 */
  --text-color: #374151; /* 深灰色，用于正文文本 */
  --heading-color: #1E3A8A; /* 标题颜色统一为主色调 */
  --shadow-color: rgba(0, 0, 0, 0.1); /* 阴影颜色 */
}

/* 全局样式设置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 页面背景 */
body {
  background: var(--background-gradient);
  font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  padding: 20px;
}

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

.navbar a {
  color: #fff;
  text-decoration: none;
  margin-left: 15px;
  font-size: 16px;
}

.navbar a:hover {
  color: var(--accent-green);
  transition: color 0.3s ease;
}

/* 主容器，避免内容被导航栏遮挡 */
.main-container {
  margin-top: 80px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* 文章标题样式 */
h2, h3, h4 {
  color: var(--heading-color);
  margin-bottom: 15px;
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 20px;
}

h4 {
  font-size: 18px;
}

/* 段落样式 */
p {
  margin-bottom: 20px;
  font-size: 16px;
}

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

/* 每个卡片的样式 */
.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 6px var(--shadow-color);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 12px var(--shadow-color);
}

/* 图片样式，圆角加阴影 */
.card img {
  width: 100%;
  max-width: 650px;
  border-radius: 10px;
  box-shadow: 0 4px 6px var(--shadow-color);
  transition: transform 0.3s ease;
}

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

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

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

/* 代码块样式，区别于正文 */
pre {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  margin-bottom: 20px;
}

code {
  font-family: 'Courier New', Courier, monospace;
  color: #d6336c;
}

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

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

th {
  background-color: var(--primary-color);
  color: #fff;
}

tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

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

  .navbar a {
    margin: 10px 0;
  }

  .container {
    grid-template-columns: 1fr;
  }

  .card img {
    max-width: 100%;
  }
}

/* 强调用于提示 */
.notice {
  background-color: var(--accent-orange);
  color: #fff;
  padding: 20px;
  text-align: center;
  border-radius: 5px;
  margin-bottom: 30px;
  font-size: 18px;
}

/* 图片描述属性为空 */
img[alt=""] {
  display: block;
}

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

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

/* 过渡动画 */
.feature-icon:hover {
  transform: scale(1.2);
  transition: transform 0.3s ease;
}

/* 可折叠内容样式 */
.collapsible {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: max-height 0.3s ease;
  overflow: hidden;
}

.collapsible.active {
  max-height: 500px; /* 根据内容高度调整 */
}

/* 智能推荐内容过渡 */
.content-recommendation {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.content-recommendation.visible {
  opacity: 1;
  transform: translateY(0);
}

