
/* 全局样式设置 */
body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(135deg, #001f3f, #0074D9);
  color: #FFFFFF;
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  overflow-x: hidden;
}

/* 渐变动画关键帧 */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 容器布局 */
.container {
  display: grid;
  grid-template-areas:
    "header"
    "main"
    "footer";
  grid-template-columns: 1fr;
  grid-template-rows: 60px 1fr 40px;
  height: 100vh;
  gap: 20px;
  padding: 20px;
}

/* 头部导航栏样式 */
header {
  grid-area: header;
  background-color: rgba(0, 31, 63, 0.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* 导航菜单样式 */
nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
}

nav ul li a {
  color: #FFFFFF;
  text-decoration: none;
  font-size: 16px;
  transition: color 0.3s ease, transform 0.3s ease;
}

nav ul li a:hover {
  color: #2ECC40;
  transform: scale(1.1);
}

/* 主内容区域样式 */
main {
  grid-area: main;
  margin-top: 80px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* 章节区块样式 */
section {
  background: rgba(0, 31, 63, 0.7);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease;
}

section:hover {
  transform: translateY(-5px);
}

/* 渐变分隔线 */
.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, #2ECC40, #0074D9);
}

/* 标题样式 */
h2 {
  font-size: 24px;
  margin-bottom: 20px;
  color: #2ECC40;
  position: relative;
}

h2::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: #2ECC40;
  margin-top: 10px;
}

/* 段落样式 */
p {
  font-size: 16px;
  line-height: 1.6;
  color: #FFFFFF;
}

/* 强调文本样式 */
.highlight {
  color: #2ECC40;
  font-weight: bold;
}

/* 图片样式 */
img.decorative {
  width: 100%;
  max-width: 320px;
  border-radius: 15px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  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.7);
}

/* 底部信息区域样式 */
footer {
  grid-area: footer;
  background-color: rgba(0, 31, 63, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  color: #CCCCCC;
  font-size: 14px;
  position: fixed;
  bottom: 0;
  width: 100%;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.5);
}

footer a {
  color: #2ECC40;
  text-decoration: none;
  margin: 0 10px;
  transition: color 0.3s ease;
}

footer a:hover {
  color: #28A745;
}

/* 交互按钮样式 */
button.auth-button {
  background-color: #2ECC40;
  border: none;
  padding: 15px 30px;
  color: #FFFFFF;
  font-size: 16px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

button.auth-button:hover {
  background-color: #28A745;
  transform: translateY(-3px);
}

/* 响应式设计 */
@media (max-width: 1200px) {
  h2 {
    font-size: 22px;
  }

  p {
    font-size: 15px;
  }

  nav ul {
    gap: 15px;
  }
}

@media (max-width: 768px) {
  .container {
    grid-template-areas:
      "header"
      "main"
      "footer";
  }

  nav ul {
    flex-direction: column;
    background-color: rgba(0, 31, 63, 0.9);
    position: fixed;
    top: 60px;
    right: -100%;
    width: 200px;
    height: calc(100% - 60px);
    transition: right 0.3s ease;
  }

  nav ul.active {
    right: 0;
  }

  nav ul li {
    margin: 20px 0;
    text-align: center;
  }

  .menu-toggle {
    display: block;
    cursor: pointer;
  }
}

@media (max-width: 480px) {
  h2 {
    font-size: 20px;
  }

  p {
    font-size: 14px;
  }

  button.auth-button {
    padding: 10px 20px;
    font-size: 14px;
  }
}

/* 菜单切换动画 */
.menu-toggle::before,
.menu-toggle::after,
.menu-toggle div {
  width: 25px;
  height: 3px;
  background-color: #FFFFFF;
  margin: 5px 0;
  transition: all 0.3s ease;
}

nav.active .menu-toggle::before {
  transform: rotate(45deg) translate(5px, 5px);
}

nav.active .menu-toggle::after {
  transform: rotate(-45deg) translate(5px, -5px);
}

nav.active ul {
  right: 0;
}

/* 代码示例样式 */
.code-example {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 20px 0;
}

.code-example pre {
  margin: 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
}

