/* 全局变量与重置 */
:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --light-color: #ecf0f1;
  --dark-color: #2c3e50;
  --text-color: #333;
  --text-light: #7f8c8d;
  --max-width: 1200px;
  --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;
  -webkit-tap-highlight-color: transparent;
}

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

a {
  text-decoration: none;
  color: var(--secondary-color);
  transition: var(--transition);
}

ul li {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 10px;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--secondary-color);
  color: white;
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-size: 16px;
  text-align: center;
}

.btn:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
  box-shadow: var(--box-shadow);
}

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

.btn-accent:hover {
  background-color: #c0392b;
}

.section-header.active .toggle-arrow {
  transform: rotate(180deg);
}

.toggle-arrow {
  transition: transform 0.3s ease;
}

.section {
  padding: 60px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 40px;
  font-size: 32px;
  color: var(--primary-color);
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background-color: var(--secondary-color);
  margin: 15px auto;
}

/* 导航栏 */
.navbar {
  background-color: white;
  box-shadow: var(--box-shadow);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary-color);
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
}

.nav-links li {
  margin-left: 30px;
}

.nav-links a {
  color: var(--text-color);
  font-weight: 500;
  font-size: 16px;
}

.nav-links a:hover {
  color: var(--secondary-color);
}

.mobile-menu-box {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

.mobile-menu-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.mobile-menu-btn,
.mobile-menu-btn:focus {
  background: transparent;
  outline: none;
}

.user-info {
  display: flex;
  align-items: center;
}

.user-icon {
  width: 18px;
  margin-right: 5px;
}

/* 英雄区域 */
.hero {
  /* background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); */
  padding: 100px 0 80px;
  text-align: center;
}

.hero-title {
  font-size: 40px;
  margin-top: 40px;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.hero-subtitle {
  font-size: 20px;
  color: var(--text-light);
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero-btns {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

.book-cover {
  max-width: 60%;
  margin: 0 auto;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  border-radius: var(--border-radius);
}

/* 亮点区域 */
.highlights {
  background-color: white;
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.highlight-card {
  background-color: var(--light-color);
  padding: 30px;
  border-radius: var(--border-radius);
  text-align: center;
  transition: var(--transition);
}

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

.highlight-icon {
  font-size: 40px;
  color: var(--secondary-color);
  margin-bottom: 20px;
}

/* 试读区域 */
.preview {
  background-color: #f5f7fa;
}

.preview-content {
  background-color: white;
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-top: 30px;
}

.preview-section {
  margin-bottom: 30px;
}

/* .preview-section h3 {
  margin-bottom: 15px;
  color: var(--primary-color);
  border-bottom: 2px solid var(--light-color);
  padding-bottom: 10px;
} */

/* 购买区域 */
.purchase-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.purchase-card {
  background-color: white;
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  text-align: center;
}

.qrcode-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  margin-top: 40px;
}

.qrcode-item {
  text-align: center;
  margin: 20px;
}

.qrcode-img {
  width: 150px;
  height: 150px;
  margin-bottom: 15px;
}

/* 留言区域 */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  background-color: white;
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

@media screen and (max-width: 600px) {
  .contact-form {
    width: 100%;
    max-width: 100%;
  }
}

.form-group {
  margin-bottom: 20px;
}

.input-group {
  display: flex;
}

.input-group input {
  border-right: 0;
  border-radius: 8px 0 0 8px;
}

.fc-code {
  border: 1px solid #ddd;
  border-left: 0;
}

.fc-code img {
  height: 44px;
  cursor: pointer;
}

.input-group-btn {
  font-size: 0;
  white-space: nowrap;
  /* width: 1%; */
  vertical-align: middle;
}

/* .mt-checkbox>input, .mt-radio>input {
  position: absolute;
  z-index: -1;
  opacity: 0;
  filter: alpha(opacity=0);
} */

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 16px;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--secondary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
  font-family: "";
}

.required::after {
  content: ' *';
  color: var(--accent-color);
}

/* 页脚 */
.footer {
  background-color: var(--primary-color);
  color: white;
  padding: 60px 0 20px;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  list-style: none;
  margin-bottom: 30px;
}

.footer-links li {
  margin: 0 15px;
}

.footer-links a {
  color: white;
}

.footer-links a:hover {
  color: var(--secondary-color);
}

.copyright {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

/* 登录模态框 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: white;
  padding: 30px;
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 400px;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
  background: none;
  border: none;
}

.user-box {
  display: flex;
  margin-left: 50px !important;
}


/* 试读折叠样式 */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  margin-bottom: 15px;
  color: var(--primary-color);
  border-bottom: 2px solid var(--light-color);
  padding-bottom: 10px;
}

.section-header h3 {
  margin: 0;
}

.toggle-arrow {
  transition: transform 0.3s ease;
  font-size: 0.8em;
}

.section-content {
  overflow: hidden;
  transition: all 0.3s ease;
  padding: 10px 0;
}

.section-content.collapsed {
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 3em;
  display: none;
}

.section-content.expanded {
  display: block;
  /*max-height: 1000px;*/
  /* 足够大的值容纳内容 */
}

.section-header.active .toggle-arrow {
  transform: rotate(180deg);
}


/* 章节展示 */
.chapter {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.chapter-box {
  box-sizing: border-box;
  width: 50%;
  margin-bottom: 20px;
}

.chapter-box:nth-child(odd) {
  padding-right: 15px;
}

.chapter-box:nth-child(even) {
  padding-left: 15px;
}

.chapter-title {
  margin-bottom: 10px;
  color: var(--primary-color);
  font-size: 20px;
  font-weight: 400;
  display: flex;
  justify-content: space-between;
}

.chapter-list-item a {
  color: var(--text-color);
  font-weight: 500;
  font-size: 16px;
  line-height: 30px;
}

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

.btn-group-vertical>.btn,
.btn-group>.btn {
  position: relative;
  float: left;
}

.btn-group label {
  margin-bottom: 20px;
}

.btn-default {
  color: #949494;
  background-color: #e6e6e6;
  border-color: #adadad;
}

.btn-default.active,
.btn-default:active,
.btn-default:hover,
.open>.btn-default.dropdown-toggle {
  color: #fff;
  background-color: var(--secondary-color);;
  border-color: var(--secondary-color);;
}

input[type=checkbox],
input[type=radio] {
  box-sizing: border-box;
  padding: 0;
}

input[type=checkbox],
input[type=radio] {
  margin: 4px 0 0;
  margin-top: 1px;
  line-height: normal;
}

[data-toggle=buttons]>.btn input[type=checkbox],
[data-toggle=buttons]>.btn input[type=radio],
[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],
[data-toggle=buttons]>.btn-group>.btn input[type=radio] {
  position: absolute;
  clip: rect(0, 0, 0, 0);
  pointer-events: none;
}

.form-actions {
  clear: both;
  display: block;
  padding: 20px 0;
  margin: 0;
  border-top: 1px solid #e7ecf1;
}

/* 响应式设计 */
@media (max-width: 1199px) {
  .book-cover {
    max-width: 80%;
  }
}

@media (max-width: 991px) {}

@media (max-width: 768px) {
  
  .preview-content {
    padding: 20px 15px;
  }
    
  .book-cover {
    max-width: 100%;
  }

  .navbar-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: normal;
    width: 100%;
    margin-top: 20px;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links li {
    margin: 10px 0;
  }

  .user-box {
    display: none;
  }

  .mobile-menu-box {
    display: flex;
    align-items: center;
    position: absolute;
    top: 22px;
    right: 20px;
  }

  .mobile-user-info {
    display: flex;
    align-items: center;
    margin-right: 20px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 18px;
  }

  /* .mobile-menu-btn {
    display: block;
    position: absolute;
    top: 15px;
    right: 20px;
  } */

  .mobile-user-icon {
    width: 24px;
  }

  .hero-btns {
    flex-direction: column;
    gap: 15px;
  }

  .btn {
    width: 100%;
  }

  .section {
    padding: 40px 0;
  }

  .section-title {
    font-size: 28px;
  }

  .contact-form {
    padding: 20px;
  }

  .chapter-box {
    width: 100%;
  }

  .chapter-box:nth-child(odd) {
    padding-right: 0;
  }

  .chapter-box:nth-child(even) {
    padding-left: 0;
  }
}

@media (max-width: 480px) {
  .footer-links {
    flex-direction: column;
  }

  .footer-links li {
    margin: 8px 0;
  }
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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


.arrow {
  cursor: pointer;
  transition: transform 0.3s;
}

.arrow.down {
  transform: rotate(90deg);
}

.chapter-list li {
  display: none;
}

.chapter-list li:nth-child(-n+2) {
  display: block;
}











