
/* 基础样式与全局设置 */
body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  color: #333;
  line-height: 1.6;
  background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
  transition: background 0.5s ease, color 0.5s ease;
}
body.dark-mode {
  --bg-color: #121212;
  --text-color: #ffffff;
  background: linear-gradient(135deg, #1e1e1e, #3a3a3a);
  color: var(--text-color);
}
h1, h2, h3 {
  font-weight: bold;
  color: #4A90E2;
  text-align: center;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  gap: 20px;
}
@media (max-width: 768px) {
  .container {
    padding: 10px;
    grid-template-columns: 1fr;
  }
}

/* 模块化布局与装饰 */
.module {
  background: rgba(255, 255, 255, 0.8);
  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;
}
.module:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}
.decorative-image {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 15px;
}
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}
.image-grid img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
  transition: transform 0.3s ease;
}
.image-grid img:hover {
  transform: scale(1.1);
}

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in {
  animation: fadeIn 1s ease-in-out;
}
.line-animation {
  width: 0;
  height: 2px;
  background: linear-gradient(to right, #4A90E2, #8A2BE2);
  animation: growLine 2s ease-in-out forwards;
}
@keyframes growLine {
  to { width: 100%; }
}

/* 文章排版与代码高亮 */
.article-section {
  background: rgba(255, 255, 255, 0.9);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
}
.article-section pre {
  background: #2d2d2d;
  color: #ffffff;
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
}
.article-section code {
  font-family: 'Consolas', monospace;
  font-size: 14px;
}

/* 按钮与交互 */
.button {
  display: inline-block;
  padding: 10px 20px;
  background: linear-gradient(90deg, #4A90E2, #8A2BE2);
  color: white;
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.3s ease;
}
.button:hover {
  background: linear-gradient(90deg, #8A2BE2, #FF6F61);
}

