
/* 颜色变量定义 */
:root {
  --primary-color: #0d47a1; /* 主色调，深蓝色，传达科技感与专业性 */
  --secondary-color: #00695c; /* 辅助色，蓝绿色，增加层次感与动感 */
  --accent-color: #ff6f00; /* 点缀色，亮橙色，用于吸引视线 */
  --background-gradient: linear-gradient(135deg, #0d47a1, #00695c); /* 背景渐变，增强视觉深度 */
  --text-color: #ffffff; /* 文字颜色，白色，确保良好的可读性 */
  --shadow-color: rgba(0, 0, 0, 0.2); /* 阴影颜色，用于盒子和文本阴影 */
}

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

/* 固定导航栏 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: rgba(13, 71, 161, 0.9);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  box-shadow: 0 2px 4px var(--shadow-color);
  z-index: 1000;
  transition: background-color 0.3s ease;
}

.navbar.scrolled {
  background-color: var(--primary-color);
}

.navbar .logo {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5em;
  font-weight: bold;
}

.navbar .nav-links a {
  color: var(--text-color);
  text-decoration: none;
  margin: 0 15px;
  transition: color 0.3s ease;
}

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

/* 主容器 */
.container {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  padding: 100px 50px 50px 50px; /* 顶部留出导航栏空间 */
}

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

.module:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 12px var(--shadow-color);
}

/* 文章样式 */
article {
  grid-column: span 8;
}

article h2, article h3, article h4 {
  font-family: 'Montserrat', sans-serif;
  color: #ffffff;
}

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

article h3 {
  font-size: 1.5em;
  margin-top: 20px;
  margin-bottom: 10px;
}

article p {
  font-size: 1em;
  margin-bottom: 15px;
  color: #e0e0e0;
}

article pre {
  background: rgba(255, 255, 255, 0.2);
  padding: 15px;
  border-radius: 8px;
  overflow-x: auto;
}

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

/* 图片样式 */
img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 8px var(--shadow-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

img:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 16px var(--shadow-color);
}

/* 强调用语 */
.highlight {
  font-size: 1.2em;
  color: var(--accent-color);
  text-align: center;
  margin: 40px 0;
}

/* 代码块样式 */
.code-block {
  background-color: #1e1e1e;
  color: #dcdcdc;
  padding: 20px;
  border-radius: 8px;
  font-family: 'Courier New', Courier, monospace;
  overflow-x: auto;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .container {
    grid-template-columns: repeat(8, 1fr);
  }
}

@media (max-width: 992px) {
  .container {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 768px) {
  .container {
    grid-template-columns: repeat(4, 1fr);
  }
  article {
    grid-column: span 4;
  }
}

@media (max-width: 576px) {
  .container {
    grid-template-columns: repeat(2, 1fr);
    padding: 100px 20px 20px 20px;
  }
  article {
    grid-column: span 2;
  }
}

/* 底部样式 */
.footer {
  background-color: var(--primary-color);
  padding: 40px 30px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  color: #ffffff;
}

.footer-section {
  flex: 1 1 200px;
  margin: 10px;
}

.footer-section h4 {
  font-family: 'Montserrat', sans-serif;
  margin-bottom: 15px;
}

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

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

.footer-section ul li a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section ul li a:hover {
  color: var(--accent-color);
}

/* 交互动效 */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in {
  opacity: 0;
  transform: translateX(-20px);
  animation: slideInLeft 1s forwards;
}

@keyframes slideInLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 搜索栏样式 */
.search-bar {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.search-bar input[type="text"] {
  width: 50%;
  padding: 10px 15px;
  border: none;
  border-radius: 4px 0 0 4px;
  outline: none;
}

.search-bar button {
  padding: 10px 20px;
  border: none;
  background-color: var(--accent-color);
  color: #ffffff;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.search-bar button:hover {
  background-color: darkorange;
}

/* 鼠标悬停效果 */
.hover-effect {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hover-effect:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

/* 加载动画 */
.load-animation {
  opacity: 0;
  animation: fadeIn 2s forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

