/* 书籍页面整体布局样式 */
body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background-color: #f4f4f4;
}

nav {
  background-color: #333;
  color: #fff;
  padding: 10px;
}

nav ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: space-around;
}

nav ul li a {
  color: #fff;
  text-decoration: none;
}

main {
  padding: 20px;
}

.carousel {
  width: 100%;
  height: 300px;
  overflow: hidden;
  position: relative;
}

.carousel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.carousel img.active {
  opacity: 1;
}

.book-categories {
  margin-top: 20px;
}

.book-categories h2 {
  border-bottom: 2px solid #333;
  padding-bottom: 5px;
}

.book-categories ul {
  list-style-type: none;
  padding: 0;
}

.book-categories ul li {
  margin-top: 10px;
}

.book-categories ul li a {
  text-decoration: none;
  color: #333;
}

.book-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.book-list.book-item {
  background-color: #fff;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  padding: 10px;
  text-align: center;
}

.book-list.book-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.book-list.book-item h3 {
  margin-top: 10px;
  font-size: 18px;
}

.book-list.book-item p {
  color: #666;
  font-size: 14px;
}

.user-comments h2 {
  margin-top: 20px;
}

.user-comments ul {
  list-style-type: none;
  padding: 0;
}

.user-comments ul li {
  background-color: #fff;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  padding: 10px;
  margin-top: 10px;
}

.user-comments ul li p {
  margin: 0;
}

#comment-form {
  margin-top: 20px;
}

#comment-form label {
  display: block;
  margin-bottom: 5px;
}

#comment-form input,
#comment-form textarea {
  width: 100%;
  padding: 5px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
}

#comment-form input[type="submit"] {
  background-color: #333;
  color: #fff;
  cursor: pointer;
}