/* 全局样式 */
:root {
  --primary-color: #3a5a78;
  --secondary-color: #f0f4f8;
  --accent-color: #e67e22;
  --text-color: #333;
  --light-text: #666;
  --white: #fff;
  --border-radius: 8px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #f9f9f9;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 头部样式 */
header {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 2rem 0;
  text-align: center;
  position: relative;
}

.header-content {
  position: relative;
  z-index: 2;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

header p {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* 导航栏 */
nav {
  background-color: var(--white);
  box-shadow: var(--box-shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
}

.nav-menu {
  display: flex;
  list-style: none;
}

.nav-item {
  margin-left: 1.5rem;
}

.nav-link {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

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

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--primary-color);
}

/* 主要内容区 */
main {
  padding: 3rem 0;
}

.section {
  margin-bottom: 4rem;
}

.section-title {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-color);
}

/* 章节卡片 */
.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.chapter-card {
  background-color: var(--white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
}

.chapter-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.chapter-content {
  padding: 1.5rem;
}

.chapter-title {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.chapter-summary {
  margin-bottom: 1.5rem;
  color: var(--light-text);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.audio-player {
  width: 100%;
  margin-top: 1rem;
}

/* 作者介绍 */
.author-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background-color: var(--secondary-color);
  padding: 3rem;
  border-radius: var(--border-radius);
  margin-bottom: 4rem;
}

.author-image {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 2rem;
  border: 4px solid var(--white);
  box-shadow: var(--box-shadow);
}

.author-content h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.author-content p {
  max-width: 800px;
  margin: 0 auto 1.5rem;
}

/* 详细章节内容 */
.chapter-detail {
  background-color: var(--white);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 2rem;
}

.chapter-detail h3 {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}

.chapter-detail p {
  margin-bottom: 1rem;
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background-color: var(--accent-color);
  color: var(--white);
  border: none;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn:hover {
  background-color: #d35400;
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--accent-color);
  color: var(--accent-color);
}

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

/* 页脚 */
footer {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 3rem 0;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-logo {
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  list-style: none;
  margin-bottom: 2rem;
}

.footer-link {
  margin: 0 1rem;
}

.footer-link a {
  color: var(--white);
  text-decoration: none;
  transition: var(--transition);
}

.footer-link a:hover {
  color: var(--accent-color);
}

.footer-text {
  opacity: 0.8;
  font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }
  
  .nav-menu {
    position: fixed;
    top: 60px;
    left: -100%;
    flex-direction: column;
    background-color: var(--white);
    width: 100%;
    text-align: center;
    transition: 0.3s;
    box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
  }
  
  .nav-menu.active {
    left: 0;
  }
  
  .nav-item {
    margin: 1.5rem 0;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .author-section {
    padding: 2rem 1rem;
  }
  
  .chapters-grid {
    grid-template-columns: 1fr;
  }
}

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

.fade-in {
  animation: fadeIn 0.8s ease forwards;
}

/* 章节详情页样式 */
.chapter-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.chapter-page h2 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}

.chapter-page .audio-player {
  margin: 2rem 0;
  width: 100%;
}

.chapter-content p {
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.chapter-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
}

/* 模态框样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: var(--white);
  margin: 10% auto;
  padding: 2rem;
  border-radius: var(--border-radius);
  max-width: 800px;
  animation: fadeIn 0.3s;
}

.close-modal {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-modal:hover {
  color: var(--text-color);
}

/* 自定义音频播放器样式 */
.custom-audio-player {
  background-color: var(--secondary-color);
  border-radius: var(--border-radius);
  padding: 1rem;
  margin: 1.5rem 0;
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.play-btn {
  background-color: var(--accent-color);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.play-btn:hover {
  background-color: #d35400;
}

.progress-container {
  flex-grow: 1;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background-color: #ddd;
  border-radius: 3px;
  cursor: pointer;
}

.progress {
  height: 100%;
  background-color: var(--accent-color);
  border-radius: 3px;
  width: 0%;
}

.time-display {
  font-size: 0.9rem;
  color: var(--light-text);
  min-width: 100px;
  text-align: right;
}
