/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "SimSun", "宋体", serif;
  background-color: #f4f4f4;
  color: #333;
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

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

/* 移除所有过渡效果 */
* {
  transition: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* --- Header --- */
.header {
  background-color: #fff;
  border-bottom: 2px solid #0055aa;
  padding: 10px 0;
  width: 100%;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo h1 {
  margin: 0;
  font-size: 28px;
  color: #0055aa;
}

.logo .tagline {
  font-size: 12px;
  color: #888;
}

.nav-menu a {
  color: #333;
  text-decoration: none;
  padding: 5px 15px;
  font-size: 16px;
  border-bottom: 2px solid transparent;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: #d00;
  border-bottom: 2px solid #d00;
  background-color: #f0f0f0;
}

.search-box {
  display: flex;
}

.search-box input {
  border: 1px solid #ccc;
  padding: 5px;
  font-size: 14px;
  width: 200px;
}

.search-box button {
  border: 1px solid #0055aa;
  background-color: #0055aa;
  color: white;
  padding: 5px 10px;
  cursor: pointer;
}

/* --- Main Content --- */
.main {
  padding: 20px 0;
}

.hero-section {
  background: #fff;
  padding: 20px;
  border: 1px solid #ddd;
  margin-bottom: 20px;
}

.featured-book {
  display: flex;
}

.book-cover {
  margin-right: 20px;
}

.book-cover img {
  width: 150px;
  height: auto;
  border: 1px solid #ccc;
}

.book-info .book-title {
  font-size: 24px;
  color: #d00;
  margin: 0 0 10px;
}

.book-info .book-author {
  color: #666;
  font-size: 14px;
}

.book-info .book-desc {
  font-size: 14px;
  color: #555;
  margin-top: 10px;
}

.book-stats {
  margin-top: 15px;
  font-size: 12px;
  color: #888;
}

.book-stats .stat {
  margin-right: 15px;
}

.book-actions {
  margin-top: 20px;
}

.btn-primary {
  background-color: #d00;
  color: #fff;
  border: 1px solid #a00;
  padding: 8px 20px;
  text-decoration: none;
  font-size: 16px;
  cursor: pointer;
  font-family: "SimSun", "宋体", serif;
}

.btn-primary:hover {
  background-color: #a00;
}

.btn-secondary {
  background-color: #f0f0f0;
  color: #333;
  border: 1px solid #ccc;
  padding: 8px 20px;
  text-decoration: none;
  font-size: 16px;
  cursor: pointer;
  font-family: "SimSun", "宋体", serif;
  margin-left: 10px;
}

.btn-secondary:hover {
  background-color: #e0e0e0;
  border-color: #bbb;
}

/* --- Details Page --- */
.book-details-card {
  background: #fff;
  padding: 20px;
  border: 1px solid #ddd;
  margin-top: 20px;
}

.book-meta {
  display: flex;
  margin-bottom: 20px;
}

.book-cover-img {
  width: 150px;
  height: 200px;
  border: 1px solid #ccc;
  margin-right: 20px;
  object-fit: cover;
}

.book-info h1 {
  font-size: 24px;
  color: #d00;
  margin: 0 0 10px;
}

.book-info p {
  font-size: 14px;
  color: #555;
  margin-bottom: 10px;
}

.chapter-list h2 {
  font-size: 20px;
  border-bottom: 2px solid #0055aa;
  padding-bottom: 5px;
  margin-bottom: 10px;
}

#chapter-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
  list-style: none;
  padding: 0;
}

#chapter-container a {
  text-decoration: none;
  color: #333;
  padding: 5px;
  border-bottom: 1px solid #eee;
  display: block;
}

#chapter-container a:hover {
  background-color: #f0f0f0;
  color: #d00;
}

/* --- Reader Page --- */
.reader-container {
  background: #fff;
  padding: 20px;
  border: 1px solid #ddd;
  margin-top: 20px;
  min-height: 70vh;
}

#reader-chapter-title {
  font-size: 28px;
  text-align: center;
  margin-bottom: 20px;
  color: #0055aa;
}

.reader-content {
  font-size: 18px;
  line-height: 1.8;
  text-indent: 2em;
  white-space: pre-wrap; /* Preserve whitespace and newlines */
}

.reader-nav {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.reader-nav button {
  padding: 10px 30px;
  font-size: 16px;
  cursor: pointer;
  border: 1px solid #0055aa;
  background-color: #fff;
  color: #0055aa;
  margin: 0 10px;
}

.reader-nav button:hover {
  background-color: #0055aa;
  color: #fff;
}

.reader-nav button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Ranking Section --- */
.ranking-section {
  background: #fff;
  padding: 20px;
  border: 1px solid #ddd;
  margin-bottom: 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #0055aa;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.section-header h2 {
  font-size: 20px;
  margin: 0;
  color: #0055aa;
}

.tabs .tab {
  background: #eee;
  border: 1px solid #ccc;
  border-bottom: none;
  padding: 5px 15px;
  cursor: pointer;
  font-size: 14px;
}

.tabs .tab.active {
  background: #fff;
  border-bottom: 1px solid #fff;
  position: relative;
  top: 1px;
}

.ranking-item {
  display: flex;
  padding: 10px 5px;
  border-bottom: 1px dotted #ccc;
  font-size: 14px;
  cursor: pointer;
}

.ranking-item:hover {
  background-color: #f5f5f5;
}

.ranking-item .rank {
  width: 40px;
  font-weight: bold;
  color: #666;
  font-family: Arial, sans-serif;
}

.ranking-item .rank.rank-1,
.ranking-item .rank.rank-2,
.ranking-item .rank.rank-3 {
  color: #d00;
}

.ranking-item .book-title {
  flex-grow: 1;
  color: #0055aa;
}

.ranking-item .book-author {
  width: 120px;
  color: #666;
  text-align: right;
}

/* --- Category Section --- */
.category-section {
  background: #fff;
  padding: 20px;
  border: 1px solid #ddd;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-item {
  border-bottom: 1px dotted #ccc;
  padding: 8px 5px;
  font-size: 14px;
}

.category-item a {
  text-decoration: none;
  color: #333;
  margin-right: 15px;
}

.category-item a:hover {
  color: #d00;
  text-decoration: underline;
}

.category-item strong {
  color: #0055aa;
}

/* --- Footer --- */
.footer {
  text-align: center;
  padding: 20px 0;
  margin-top: 20px;
  border-top: 1px solid #ccc;
  font-size: 12px;
  color: #888;
}

/* --- Modal --- */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 20px;
  border: 5px solid #0055aa;
  width: 80%;
  max-width: 800px;
  height: 80%;
  display: flex;
  flex-direction: column;
}

.reader-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ccc;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.reader-header h3 {
  margin: 0;
  font-size: 20px;
}

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

.close-btn:hover,
.close-btn:focus {
  color: black;
}

.reader-body {
  flex-grow: 1;
  overflow-y: auto;
  background: #fff;
  padding: 10px;
  border: 1px solid #ccc;
  font-size: 16px;
  line-height: 1.8;
}

.reader-body p {
  margin-bottom: 1em;
}

.reader-controls {
  padding-top: 15px;
  text-align: center;
  border-top: 1px solid #ccc;
  margin-top: 10px;
}

.reader-controls button {
  margin: 0 20px;
}

/* --- Responsive (simple) --- */
@media (max-width: 768px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-menu {
    margin-top: 10px;
  }
  .search-box {
    margin-top: 10px;
    width: 100%;
  }
  .search-box input {
    width: 100%;
  }
  .featured-book {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .book-cover {
    margin-right: 0;
    margin-bottom: 15px;
  }
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .modal-content {
    width: 95%;
    margin: 5% auto;
  }
}
