
/* 全局样式设置 */
body {
  margin: 0;
  padding: 0;
  /* 设置背景为线性渐变，从深蓝到紫色，营造科技感 */
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  color: #ffffff;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  /* 使用流式布局确保响应式设计 */
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 容器样式 */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 80px 0; /* 留出导航栏空间 */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 40px;
}

/* 模块样式 */
.module {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

/* 模块悬停效果 */
.module:hover {
  transform: translateY(-10px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

/* 标题样式 */
h2, h3, h4 {
  color: #ffffff;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* 正文字体大小 */
p {
  font-size: 16px;
  line-height: 1.6;
  color: #f0f0f0;
}

/* 按钮样式 */
.button-primary {
  background: linear-gradient(45deg, #ff7e5f, #feb47b);
  border: none;
  border-radius: 25px;
  color: #ffffff;
  padding: 12px 30px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

/* 按钮悬停效果 */
.button-primary:hover {
  background: linear-gradient(45deg, #feb47b, #ff7e5f);
  transform: scale(1.05);
}

/* 图片样式 */
img.decorative {
  width: 100%;
  max-width: 320px;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 图片悬停效果 */
img.decorative:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}

/* 代码块样式 */
pre code {
  background: rgba(0, 0, 0, 0.7);
  padding: 20px;
  border-radius: 10px;
  display: block;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}

/* 代码块前标题 */
pre code::before {
  content: "CSS3 代码示例";
  position: absolute;
  top: -25px;
  left: 0;
  background: #ff7e5f;
  color: #ffffff;
  padding: 5px 10px;
  border-radius: 5px 5px 0 0;
  font-size: 14px;
}

/* 分割线 */
.separator {
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, #4facfe, #00f2fe);
  margin: 40px 0;
  animation: fadeIn 2s ease-in-out;
}

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

/* 动态分割线 */
.dynamic-separator {
  border: none;
  height: 2px;
  background: linear-gradient(to right, #4facfe, #00f2fe);
  margin: 40px 0;
  animation: dash 5s linear infinite;
}

/* dash 动画 */
@keyframes dash {
  to { stroke-dashoffset: -1000; }
}

/* 响应式导航栏 */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(30, 60, 114, 0.9);
  backdrop-filter: blur(10px);
  padding: 15px 30px;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 导航链接 */
nav a {
  color: #ffffff;
  text-decoration: none;
  margin: 0 15px;
  font-size: 16px;
  transition: color 0.3s ease;
}

nav a:hover {
  color: #feb47b;
}

/* 面包屑导航 */
.breadcrumb {
  list-style: none;
  display: flex;
  gap: 10px;
  font-size: 14px;
  padding: 10px 0;
}

.breadcrumb li::after {
  content: '>';
  margin-left: 10px;
  color: #ffffff;
}

.breadcrumb li:last-child::after {
  content: '';
}

/* 卡片式布局 */
.card {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  padding: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}

/* 知识库模块 */
.knowledge-base {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.knowledge-base .article {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px;
  transition: background 0.3s ease;
}

.knowledge-base .article:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* 动态加载效果 */
.loader {
  animation: fadeInUp 1s ease forwards;
}

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

/* 知识仪表盘 */
.dashboard {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.dashboard .widget {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 15px;
  flex: 1 1 300px;
  position: relative;
  overflow: hidden;
}

.dashboard .widget::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, rgba(255, 126, 95, 0.3), rgba(254, 180, 123, 0.3));
  top: 0;
  left: -100%;
  animation: slide 5s linear infinite;
  z-index: 0;
}

.dashboard .widget > * {
  position: relative;
  z-index: 1;
}

@keyframes slide {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* 背景渐变变化 */
.background-gradient {
  background: linear-gradient(to bottom right, #1e3c72, #2a5298, #4facfe);
  transition: background 0.5s ease;
}

/* 悬停颜色变化 */
.hover-change:hover {
  background: linear-gradient(to right, #ff7e5f, #feb47b);
}

/* 页面提示文本 */
.page-note {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #ff7e5f;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* 防止水平滚动 */
html, body {
  overflow-x: hidden;
}

/* 适配不同屏幕 */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
  }
  
  nav {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .breadcrumb {
    flex-direction: column;
  }
}

