/* 全局样式 */
:root {
  --primary-color: #3498db;
  --secondary-color: #2ecc71;
  --accent-color: #9b59b6;
  --dark-color: #2c3e50;
  --light-color: #ecf0f1;
  --danger-color: #e74c3c;
  --warning-color: #f39c12;
  --success-color: #27ae60;
  --info-color: #1abc9c;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  color: #333;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

.bg-gradient {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

/* 导航栏样式 */
.navbar {
  padding: 1rem 0;
  box-shadow: var(--shadow);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
}

.navbar-brand .material-icons {
  vertical-align: middle;
  margin-right: 8px;
  font-size: 1.8rem;
}

.navbar-nav .nav-link {
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* 英雄区域样式 */
.hero-section {
  position: relative;
  overflow: hidden;
  padding: 5rem 0;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, transparent 20%, var(--primary-color) 150%);
  opacity: 0.2;
}

.hero-section .display-4 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.hero-section .lead {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.hero-section img {
  max-height: 400px;
  object-fit: cover;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
}

.hero-section img:hover {
  transform: scale(1.02);
}

/* 通用章节样式 */
.section-title {
  margin-bottom: 3rem;
}

.section-title h2 {
  font-weight: 700;
  position: relative;
  display: inline-block;
  padding-bottom: 1rem;
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 2px;
}

.section-title p {
  max-width: 600px;
  margin: 0 auto;
}

/* 卡片样式 */
.card {
  border-radius: 15px;
  border: none;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.card-header {
  background-color: white;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  font-weight: 500;
  padding: 1.25rem 1.5rem;
}

.card-body {
  padding: 1.5rem;
}

/* 代码展示样式 */
pre {
  background-color: #000;
  color: #00ff00;
  padding: 1.5rem;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.5;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
  border: 1px solid rgba(0,255,0,0.3);
}

code[class*="language-"], pre[class*="language-"] {
  font-family: 'Fira Code', 'Consolas', monospace;
  background-color: #000;
  color: #00ff00;
}

/* 按钮样式 */
.btn {
  border-radius: 50px;
  padding: 12px 30px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: #2980b9;
  border-color: #2980b9;
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .hero-section .container {
    text-align: center;
  }
  
  .hero-section .col-lg-6:last-child {
    margin-top: 2rem;
  }
  
  .btn {
    width: 100%;
    margin-bottom: 10px;
  }
  
  .row {
    margin-left: 0;
    margin-right: 0;
  }
  
  [class*="col-"] {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  .hero-section .display-4 {
    font-size: 2rem;
  }
  
  .section-title h2 {
    font-size: 1.8rem;
  }
  
  .section-title p {
    font-size: 1rem;
  }
  
  .card {
    margin-bottom: 1.5rem;
  }
  
  .navbar-brand .material-icons {
    font-size: 1.5rem;
  }
}

@media (max-width: 576px) {
  .hero-section {
    padding: 3rem 0;
  }
  
  .hero-section .display-4 {
    font-size: 1.8rem;
  }
  
  .btn {
    padding: 10px 20px;
  }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

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

.fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

.delay-1 {
  animation-delay: 0.1s;
}

.delay-2 {
  animation-delay: 0.2s;
}

.delay-3 {
  animation-delay: 0.3s;
}

/* 页脚样式 */
footer {
  margin-top: 5rem;
  padding: 3rem 0 1rem;
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #121212;
    color: #e0e0e0;
  }
  
  .card {
    background-color: #2d2d2d;
    color: #e0e0e0;
  }
  
  .card-header {
    background-color: #333;
    border-color: #444;
  }
  
  pre {
    background-color: #1e1e1e;
  }
  
  .form-control {
    background-color: #333;
    border-color: #444;
    color: #e0e0e0;
  }
}