
/* 全局样式 */
:root {
  --primary: #1e90ff;
  --secondary: #ffa500;
  --accent: #9932cc;
  --bg-light: #f8f9fa;
  --text-dark: #333;
  --text-light: #fff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@font-face {
  font-family: 'Roboto';
  src: local('Roboto'), local('Roboto-Regular');
}

@font-face {
  font-family: 'Open Sans';
  src: local('Open Sans'), local('OpenSans-Regular');
}

body {
  font-family: 'Open Sans', sans-serif;
  background: linear-gradient(135deg, #f0f0f0 0%, #ffffff 100%);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* 头部样式 */
.header {
  position: fixed;
  top: 0;
  width: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #0066cc 100%);
  color: var(--text-light);
  padding: 1.5rem 5%;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.header:hover {
  background: linear-gradient(90deg, #0066cc 0%, var(--primary) 100%);
}

.logo {
  font-family: 'Roboto', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* 主内容区 */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 120px 5% 60px;
}

/* 文章样式 */
article {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  padding: 3rem;
  margin-bottom: 3rem;
}

article h2 {
  font-family: 'Roboto', sans-serif;
  color: var(--primary);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--secondary);
  position: relative;
}

article h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100px;
  height: 2px;
  background: var(--accent);
}

article p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

article em {
  font-style: italic;
  color: var(--secondary);
}

article code {
  background-color: rgba(30, 144, 255, 0.1);
  color: var(--primary);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
}

/* 代码块样式 */
pre {
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
  border-left: 4px solid var(--primary);
  border-radius: 0 8px 8px 0;
  padding: 1.5rem;
  margin: 2rem 0;
  overflow: auto;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

pre code {
  background: transparent;
  color: #333;
  padding: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* 图片样式 */
.img-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.img-box {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.img-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.img-box img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px 12px 0 0;
  transition: transform 0.3s ease;
}

.img-box:hover img {
  transform: scale(1.03);
}

/* 列表样式 */
ol {
  margin-left: 2rem;
  margin-bottom: 2rem;
}

ol li {
  margin-bottom: 1rem;
  position: relative;
  padding-left: 1.5rem;
}

ol li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 10px;
  height: 10px;
  background-color: var(--secondary);
  border-radius: 50%;
}

/* 侧边导航 */
.side-nav {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.side-nav a {
  display: block;
  width: 50px;
  height: 50px;
  background-color: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: bold;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.side-nav a:hover {
  background-color: var(--secondary);
  transform: scale(1.1);
}

/* 页脚 */
.footer {
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  color: white;
  padding: 3rem 5%;
  text-align: center;
  margin-top: 3rem;
}

.footer p {
  margin-bottom: 1rem;
}

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.section {
  animation: fadeIn 1s ease-out forwards;
}

/* 响应式设计 */
@media (max-width: 992px) {
  .nav-links {
    gap: 1rem;
  }
  
  .side-nav {
    right: 1rem;
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    padding: 1rem;
  }
  
  .nav-links {
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .main {
    padding-top: 150px;
  }
  
  article {
    padding: 2rem;
  }
  
  .side-nav {
    display: none;
  }
}

@media (max-width: 576px) {
  article {
    padding: 1.5rem;
  }
  
  article h2 {
    font-size: 1.5rem;
  }
  
  .img-container {
    grid-template-columns: 1fr;
  }
}

/* 提示信息 */
.notice {
  background-color: rgba(255, 165, 0, 0.1);
  border-left: 4px solid var(--secondary);
  padding: 1rem;
  margin: 2rem 0;
  border-radius: 0 4px 4px 0;
  font-size: 0.9rem;
  color: #666;
}

