
/* 主题颜色变量定义 */
:root {
  --primary-color: #032B44; /* 主色调，深蓝色，传达专业与信赖 */
  --secondary-color: #FFA500; /* 辅助色，橙色，用于突出重点 */
  --accent-color: #FF7E0E; /* 点缀色，亮橙色，吸引注意力 */
  --background-color: #1E1E1E; /* 背景色，深色系，避免纯白 */
  --text-color: #FFFFFF; /* 文字主色，白色，增强可读性 */
  --shadow-color: rgba(0, 0, 0, 0.5); /* 阴影颜色，用于立体效果 */
  --transition-speed: 0.3s; /* 过渡速度，统一动画时间 */
  --font-family: 'Roboto', sans-serif; /* 字体选择，现代无衬线字体 */
}

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

body {
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: var(--font-family);
  line-height: 1.6;
  padding: 0 20px;
}

/* 导航栏样式 */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: linear-gradient(135deg, var(--primary-color), #025E94);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px 0;
  box-shadow: 0 2px 4px var(--shadow-color);
  z-index: 1000;
}

nav a {
  color: var(--text-color);
  text-decoration: none;
  margin: 0 15px;
  font-size: 1.2rem;
  position: relative;
  transition: color var(--transition-speed);
}

nav a::after {
  content: '';
  display: block;
  width: 0;
  height: 2px;
  background: var(--accent-color);
  transition: width var(--transition-speed);
  position: absolute;
  bottom: -5px;
  left: 0;
}

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

nav a:hover::after {
  width: 100%;
}

/* 主内容区样式 */
.container {
  max-width: 1200px;
  margin: 100px auto 50px auto; /* 顶部留白避免导航遮挡 */
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* 提示信息样式 */
.prompt {
  text-align: center;
  font-size: 1.5rem;
  color: var(--accent-color);
  animation: fadeIn 2s ease-in-out;
}

/* 选项卡样式 */
.tabs {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.tabs button {
  background: var(--primary-color);
  color: var(--text-color);
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 1rem;
  border-radius: 5px;
  transition: background var(--transition-speed), transform var(--transition-speed);
}

.tabs button:hover {
  background: var(--secondary-color);
  transform: translateY(-3px);
}

.tabs button.active {
  background: var(--accent-color);
}

/* 内容区样式 */
.tab-content {
  display: none;
  animation: slideIn 0.5s ease-in-out;
}

.tab-content.active {
  display: block;
}

/* 图片样式 */
img.decorative {
  width: 100%;
  max-width: 320px;
  border-radius: 10px;
  box-shadow: 0 4px 6px var(--shadow-color);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

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

/* 文章样式 */
article {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 6px var(--shadow-color);
}

article h2, article h3, article h4 {
  color: var(--accent-color);
  margin-bottom: 10px;
}

article p {
  margin-bottom: 15px;
  font-size: 1rem;
}

article pre {
  background: rgba(0, 0, 0, 0.7);
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  margin-bottom: 15px;
}

article code {
  color: var(--secondary-color);
  font-family: 'Courier New', Courier, monospace;
}

/* 折叠区域样式 */
.details {
  margin-bottom: 15px;
}

details summary {
  cursor: pointer;
  color: var(--accent-color);
  font-weight: bold;
}

details[open] summary {
  color: var(--secondary-color);
}

/* 代码示例样式 */
.code-snippet {
  background: #1E1E1E;
  padding: 10px;
  border-left: 5px solid var(--accent-color);
  margin-bottom: 20px;
  border-radius: 3px;
  font-family: 'Courier New', Courier, monospace;
  color: #FFFFFF;
}

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

@keyframes slideIn {
  from { transform: translateX(-50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 响应式设计 */
@media (max-width: 768px) {
  nav {
    flex-direction: column;
    padding: 10px 0;
  }

  .tabs {
    flex-direction: column;
    align-items: center;
  }

  .container {
    margin: 120px 10px 30px 10px;
  }

  .code-snippet {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  nav a {
    margin: 5px 0;
    font-size: 1rem;
  }

  .prompt {
    font-size: 1.2rem;
  }

  .tabs button {
    padding: 8px 16px;
    font-size: 0.9rem;
  }

  article p, article h2, article h3, article h4 {
    font-size: 0.95rem;
  }
}

