/* 智能体经济学导论 - 合并样式文件 */
/* 为GitHub Pages优化 */

/* 1. 全局色彩与字体定义 */
:root {
  --font-serif: 'Lora', 'Georgia', 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --color-text-primary: #212529;
  --color-text-secondary: #5a6268;
  --color-brand-blue: #0A2540;
  --color-brand-cyan: #8B4513;
  --color-bg-light: #f8f9fa;
  --color-border: #dee2e6;
  
  /* 新变量定义 */
  --primary-color: #0A2540;
  --secondary-color: #8B4513;
  --text-primary: #212529;
  --text-secondary: #5a6268;
  --bg-light: #f8f9fa;
  --border-color: #dee2e6;
  --spacing: 2rem;
}

/* 2. 基础重置与排版 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.8;
  color: var(--color-text-primary);
  background-color: white;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--color-brand-blue);
  margin-top: 2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

h1 { 
  font-size: 2.5rem;
  font-weight: 700;
}

h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
  margin-bottom: 1.5rem;
}

a {
  color: var(--color-brand-cyan);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--color-brand-blue);
  background-color: transparent;
}

/* 3. 容器与布局 */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.site-content {
  min-height: calc(100vh - 200px);
  padding: 2rem 0;
}

/* 4. 头部样式 */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-bg-light);
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--color-brand-blue);
  font-size: 1.5rem;
  text-decoration: none;
  margin: 0;
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

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

.nav-link {
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.nav-link:hover {
  background-color: var(--secondary-color);
  color: white;
}

/* 5. 书籍布局样式 */
.book-container {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  gap: 2rem;
  padding: 0 2rem;
}

.book-sidebar {
  width: 300px;
  flex-shrink: 0;
  padding: 2rem;
  position: sticky;
  top: 2rem;
  align-self: flex-start;
  height: calc(100vh - 4rem);
  overflow-y: auto;
  background-color: #f8f9fa;
  border-radius: 10px;
  border: 1px solid var(--color-border);
}

.book-nav h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  border-bottom: 2px solid var(--color-brand-cyan);
  padding-bottom: 0.5em;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.book-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.book-nav li {
  margin-bottom: 0.5rem;
}

.book-nav a {
  display: block;
  padding: 0.75em 1em;
  border-radius: 8px;
  color: var(--color-text-secondary);
  font-family: var(--font-sans);
  font-weight: 400;
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.book-nav a:hover {
  background-color: rgba(139, 69, 19, 0.1);
  color: var(--color-brand-blue);
  border-left-color: var(--color-brand-cyan);
  transform: translateX(2px);
}

.book-nav a.active,
.book-nav .current a {
  background-color: var(--color-brand-blue);
  color: white;
  font-weight: 700;
  border-left-color: var(--color-brand-cyan);
}

.book-content {
  flex-grow: 1;
  padding: 2rem;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--color-border);
}

/* 6. 首页样式 */
.book-cover {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding: 2rem;
}

.hero-section {
  margin-bottom: 3rem;
}

.book-title {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.book-subtitle {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-weight: 400;
  line-height: 1.4;
}

.book-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-sans);
  color: var(--text-secondary);
  font-size: 1rem;
}

.separator {
  color: var(--secondary-color);
  font-weight: bold;
}

.book-intro {
  margin-bottom: 3rem;
  font-size: 1.2rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.book-intro .lead {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}

.cta-section {
  margin-bottom: 4rem;
}

.btn-start-reading {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: linear-gradient(135deg, var(--secondary-color), #00b896);
  color: white;
  text-decoration: none;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.2rem;
  border-radius: 50px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
  margin-bottom: 1.5rem;
}

.btn-start-reading:hover {
  background: linear-gradient(135deg, #009fb8, #00d4a3);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 69, 19, 0.4);
}

.btn-start-reading .arrow {
  margin-left: 0.5rem;
  transition: transform 0.3s ease;
}

.btn-start-reading:hover .arrow {
  transform: translateX(4px);
}

.secondary-actions {
  margin-top: 1rem;
}

.btn-secondary {
  display: inline-block;
  padding: 0.8rem 2rem;
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  text-decoration: none;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(10, 37, 64, 0.2);
}

.book-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 2rem;
  padding: 2rem;
  background-color: var(--bg-light);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.stat {
  text-align: center;
  font-family: var(--font-sans);
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* 7. 目录页面样式 */
.table-of-contents {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

.toc-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--border-color);
}

.toc-header h1 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 2.5rem;
}

.toc-subtitle {
  color: var(--text-secondary);
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  font-family: var(--font-sans);
}

.toc-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  font-family: var(--font-sans);
}

.toc-stat {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.toc-stat strong {
  color: var(--secondary-color);
  font-weight: 600;
}

.toc-section {
  margin-bottom: 3rem;
}

.toc-section-title {
  color: var(--primary-color);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.toc-section-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 2rem;
  font-family: var(--font-sans);
}

.toc-chapters {
  display: grid;
  gap: 1.5rem;
}

.toc-chapter {
  background-color: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  transition: all 0.3s ease;
}

.toc-chapter:hover {
  border-color: var(--secondary-color);
      box-shadow: 0 4px 12px rgba(139, 69, 19, 0.1);
  transform: translateY(-2px);
}

.chapter-number {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  background-color: var(--secondary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.2rem;
  font-family: var(--font-sans);
}

.chapter-info {
  flex: 1;
}

.chapter-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.chapter-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.chapter-title a:hover {
  color: var(--secondary-color);
}

.chapter-desc {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.btn {
  padding: 0.8rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background-color: var(--secondary-color);
  color: white;
  border: 2px solid var(--secondary-color);
}

.btn-primary:hover {
  background-color: transparent;
  color: var(--secondary-color);
  transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(139, 69, 19, 0.2);
}

/* 8. 页脚样式 */
.site-footer {
  background-color: var(--color-brand-blue);
  color: white;
  padding: 3rem 0;
  margin-top: 4rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.footer-info p {
  margin: 0.5rem 0;
  color: rgba(255, 255, 255, 0.8);
}

.footer-links a {
  color: var(--color-brand-cyan);
  text-decoration: none;
  margin-left: 2rem;
}

.footer-links a:hover {
  color: white;
  background-color: transparent;
}

/* 9. 响应式设计 */
@media screen and (max-width: 960px) {
  .book-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .book-sidebar {
    position: static;
    width: 100%;
    height: auto;
    margin-bottom: 1rem;
  }
  
  .book-content {
    padding: 1.5rem;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .footer-links a {
    margin: 0 1rem;
  }
  
  .book-cover {
    padding: 1rem;
  }
  
  .book-title {
    font-size: 2.2rem;
  }
  
  .book-subtitle {
    font-size: 1.2rem;
  }
  
  .book-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .book-stats {
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
  }
  
  .table-of-contents {
    padding: 1rem;
  }
  
  .toc-header h1 {
    font-size: 2rem;
  }
  
  .toc-stats {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .toc-chapter {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .chapter-number {
    align-self: center;
  }
}

@media screen and (max-width: 768px) {
  body {
    font-size: 16px;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.25rem; }
  
  .container {
    padding: 0 1rem;
  }
  
  .book-container {
    padding: 0 1rem;
  }
  
  .header-container {
    padding: 0 1rem;
  }
} 