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

/* 设置字体和基本颜色 */
body {
  font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
  font-size: 16px; /* 正文字号 */
  color: #dddddd; /* 文字颜色 */
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364); /* 主色调渐变背景 */
  line-height: 1.6;
  scroll-behavior: smooth; /* 平滑滚动 */
}

/* 引导语样式 */
.intro {
  text-align: center;
  padding: 50px 20px;
  font-size: 1.2em;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.5); /* 半透明背景 */
  margin: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3); /* 阴影效果 */
}

/* 导航栏样式 */
.navbar {
  position: fixed; /* 固定在顶部 */
  top: 0;
  width: 100%;
  background: rgba(20, 20, 20, 0.9); /* 半透明背景 */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  z-index: 1000; /* 确保导航栏在最上层 */
  transition: background 0.3s ease;
}

.navbar:hover {
  background: rgba(20, 20, 20, 1); /* 悬停时背景加深 */
}

.nav-item {
  position: relative;
  margin: 0 15px;
}

.nav-item a {
  color: #ffffff;
  text-decoration: none;
  font-size: 16px; /* 标题字号 */
  transition: color 0.3s ease;
}

.nav-item a:hover {
  color: #ff9800; /* 点缀色悬停效果 */
}

.dropdown {
  display: none;
  position: absolute;
  background-color: rgba(255, 255, 255, 0.1); /* 下拉菜单背景 */
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); /* 阴影效果 */
  border-radius: 5px; /* 圆角 */
  z-index: 1;
}

.nav-item:hover .dropdown {
  display: block; /* 悬停显示下拉菜单 */
}

.dropdown a {
  color: #ffffff;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  font-size: 14px;
}

.dropdown a:hover {
  background-color: rgba(255, 152, 0, 0.8); /* 下拉菜单悬停效果 */
}

/* 容器样式 */
.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); /* 模块最小宽度500px */
  gap: 40px;
  padding: 100px 20px 40px; /* 顶部留出导航栏空间 */
}

/* 模块样式 */
.module {
  background-color: rgba(255, 255, 255, 0.1); /* 半透明背景 */
  border-radius: 10px; /* 圆角 */
  padding: 20px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.25); /* 阴影效果 */
  transition: transform 0.3s ease, background 0.3s ease;
}

.module:hover {
  transform: scale(1.05); /* 悬停放大效果 */
  background: rgba(255, 255, 255, 0.2); /* 背景加深 */
}

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

h2 {
  font-size: 2em; /* 大标题字号 */
}

h3 {
  font-size: 1.5em; /* 二级标题字号 */
  color: #ff9800; /* 辅助色 */
}

h4 {
  font-size: 1.2em; /* 三级标题字号 */
  color: #4caf50; /* 辅助色 */
}

/* 段落样式 */
p {
  font-size: 1em; /* 正文字号 */
  color: #dddddd;
  margin-bottom: 15px;
}

/* 链接样式 */
a {
  color: #4caf50; /* 辅助色 */
  text-decoration: none;
  position: relative;
  transition: color 0.3s ease;
}

a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  background-color: #4caf50;
  left: 0;
  bottom: -3px;
  transition: width 0.3s ease;
}

a:hover::after {
  width: 100%; /* 悬停时下划线展开 */
}

/* 按钮样式 */
.button {
  background-color: #ff9800; /* 点缀色 */
  border: none;
  color: #ffffff;
  padding: 15px 30px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  border-radius: 50px; /* 圆润效果 */
  transition: background-color 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}

.button:hover {
  background-color: #e68900; /* 悬停变色 */
  transform: scale(1.05); /* 悬停放大 */
}

/* 图片样式 */
img.decorative {
  width: 100%;
  height: auto;
  border-radius: 15px; /* 圆角 */
  box-shadow: 0 4px 8px 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 16px rgba(0,0,0,0.5); /* 增强阴影 */
}

/* 代码块样式 */
pre code {
  display: block;
  padding: 15px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 10px;
  overflow-x: auto;
  color: #ffffff;
  font-family: 'Courier New', Courier, monospace;
  margin-bottom: 15px;
}

/* 3D动画场景 */
.scene {
  perspective: 1000px;
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  display: flex;
  justify-content: center;
  align-items: center;
}

.card {
  width: 300px;
  height: 400px;
  background-color: #ffffff;
  border-radius: 15px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.25);
  transform-style: preserve-3d;
  transition: transform 0.5s;
}

.card:hover {
  transform: rotateY(180deg);
}

.card .front, .card .back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 15px;
}

.card .back {
  background-color: #ff9800;
  transform: rotateY(180deg);
}

/* 仪表盘样式 */
.dashboard {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 20px;
}

.widget {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 20px;
  flex: 1 1 calc(33.333% - 40px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: background 0.3s ease, transform 0.3s ease;
}

.widget:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-5px); /* 悬停上浮 */
}

.widget h4 {
  margin-bottom: 15px;
  color: #ffffff;
}

.chart {
  width: 100%;
  height: 200px;
  background: #2c5364;
  border-radius: 10px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .module {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .container {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    padding: 100px 10px 20px;
  }

  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-item {
    margin: 10px 0;
  }

  .module {
    min-width: 300px; /* 确保宽度不小于300px */
  }
}

/* 按钮动画 */
.button-animated {
  background-color: #4caf50;
  border: none;
  color: #ffffff;
  padding: 15px 30px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  border-radius: 50px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
  position: relative;
  overflow: hidden;
}

.button-animated::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300%;
  height: 300%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%) rotate(45deg);
  transition: all 0.75s ease;
}

.button-animated:hover::before {
  width: 0;
  height: 0;
  opacity: 0;
}

.button-animated:hover {
  background-color: #388e3c; /* 悬停颜色 */
}

/* 脉冲动画 */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 152, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 152, 0, 0);
  }
}

.pulse-animation {
  animation: pulse 2s infinite; /* 持续脉冲效果 */
}

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

thead {
  background-color: #203a43;
  position: sticky;
  top: 0;
  z-index: 2;
}

thead th {
  padding: 15px;
  color: #ffffff;
  text-align: left;
}

tbody tr {
  background-color: rgba(255, 255, 255, 0.05);
  transition: background-color 0.3s ease;
}

tbody tr:hover {
  background-color: rgba(255, 152, 0, 0.2);
}

tbody td {
  padding: 15px;
  color: #dddddd;
}

/* 折叠区域样式 */
.collapsible {
  background-color: rgba(76, 175, 80, 0.2);
  color: #ffffff;
  cursor: pointer;
  padding: 15px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 1em;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.collapsible:hover {
  background-color: rgba(76, 175, 80, 0.4);
}

.content {
  padding: 0 15px;
  display: none;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
}

.content p {
  color: #dddddd;
}

/* 动态推荐内容样式 */
.recommendation {
  display: flex;
  overflow-x: auto;
  gap: 20px;
  padding: 20px;
}

.recommend-item {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  min-width: 200px;
  padding: 15px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.recommend-item:hover {
  transform: scale(1.05);
}

.recommend-item img {
  width: 100%;
  border-radius: 5px;
  margin-bottom: 10px;
}

.recommend-item h5 {
  color: #ffffff;
  font-size: 1.2em;
  margin-bottom: 5px;
}

.recommend-item p {
  color: #dddddd;
  font-size: 0.9em;
}

