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

body {
  font-family: '仿宋', FangSong, SimSun, sans-serif;
  background-color: white;
  color: #333;
  line-height: 1.6;
  margin: 0;
}

/* 顶部导航栏样式 */
.navbar {
  background-color: #e6f3ff; /* 淡青色导航栏 */
  padding: 10px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #ccc; /* 添加边框 */
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo-image {
  width: 40px; /* 调整logo大小 */
  height: 40px;
  margin-right: 15px;
}

.logo-text {
  font-size: 24px;
  font-weight: bold;
  color: #333;
}

.navbar ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin-right: 30px; /* 右侧间距 */
}

.navbar ul li a {
  color: #333;
  text-decoration: none;
  padding: 10px 15px;
  display: block;
  font-family: '楷体', KaiTi, SimKai, sans-serif;
}

.navbar ul li a:hover {
  background-color: #d0e8ff;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: white;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
}

.dropdown-content a {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  border-bottom: 1px solid #eee; /* 添加分隔线 */
}

.dropdown-content a:last-child {
  border-bottom: none; /* 最后一个项目不需要底部边框 */
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* 主页图片区域样式 */
.home {
  background-image: url('home-background.jpg'); /* 请替换为实际的图片路径 */
  background-size: cover;
  background-position: center;
  height: 500px;
  display: flex;
  align-items: center;
  padding-left: 50px;
}

.home h1 {
  color: white;
  font-size: 48px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* 分区展示样式 */
.sections {
  display: flex;
  flex-direction: column;
  gap: 80px; /* 增加分区之间的间距 */
  padding: 60px 40px; /* 增加上下内边距 */
}

.section {
  background-color: white;
  padding: 40px; /* 增加内部填充 */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 80vh; /* 设置最小高度为视口高度的80% */
  opacity: 0; /* 初始设置为透明 */
  transform: translateY(50px); /* 初始位置向下偏移 */
  transition: opacity 0.8s ease, transform 0.8s ease; /* 添加过渡效果 */
}

.section.visible {
  opacity: 1;
  transform: translateY(0); /* 最终位置 */
}

.section .text {
  flex: 1;
  padding-right: 40px; /* 增加右侧内边距 */
}

.section .image {
  flex: 1;
}

.section .image img {
  max-width: 100%;
  height: auto;
  display: block;
}

.section .text h2 {
  font-size: 36px; /* 增大标题字体 */
  margin-bottom: 20px;
}

.section .text h3 {
  font-size: 24px; /* 增大副标题字体 */
  margin-bottom: 20px;
}

.section .text p {
  font-size: 18px; /* 增大正文字体 */
  margin-bottom: 30px;
}

.btn {
  background-color: #333;
  color: white;
  padding: 10px 20px;
  text-align: center;
  cursor: pointer;
  border: none;
}

.btn:hover {
  background-color: #555;
}

/* 页脚样式 */
footer {
  background-color: #333;
  color: #f0f0f0; /* 淡白色文字 */
  text-align: center;
  margin-top: 40px;
}

footer .footer-content p {
  margin: 0;
}

/* 认证页面样式 */
.auth-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: calc(100vh - 100px); /* 减去导航栏和页脚的高度 */
    padding: 0 50px;
}

.anime-character {
    max-height: 80vh;
    width: auto;
}

.anime-character.left {
    order: 1;
}

.anime-character.right {
    order: 3;
}

#login, #register {
    order: 2;
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    width: 300px;
}

#login h2, #register h2 {
    text-align: center;
    margin-bottom: 20px;
}

#loginForm, #registerForm {
    display: flex;
    flex-direction: column;
}

#loginForm input, #registerForm input {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

#loginForm button, #registerForm button {
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#loginForm button:hover, #registerForm button:hover {
    background-color: #45a049;
}

/* 图片资源样式 */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
}

.image-item {
    width: calc(20% - 16px); /* 一行5个，考虑间隙 */
    margin-bottom: 20px;
    text-align: center;
}

.image-item img {
    width: 100%;
    height: auto;
    margin-bottom: 10px;
}

.image-item a {
    display: inline-block;
    padding: 5px 10px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 3px;
}

/* 电子书资源样式 */
#ebooks {
    padding: 40px 20px;
    text-align: center;
}

.quote {
    font-family: '行楷', 'KaiTi', 'STKaiti', sans-serif;
    font-size: 28px;
    margin-bottom: 30px;
}

.category-buttons {
    margin-bottom: 30px;
}

.category-btn {
    font-family: '仿宋', 'FangSong', 'STFangsong', sans-serif;
    font-size: 18px;
    padding: 10px 20px;
    margin: 0 10px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.category-btn:hover, .category-btn.active {
    background-color: #4CAF50;
    color: white;
}

.ebook-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px; /* 减小间隔 */
    justify-content: space-between;
    padding: 0 20px; /* 减小左右内边距 */
}

.ebook-item {
    width: calc(25% - 15px); /* 一行四本书 */
    margin-bottom: 20px;
    text-align: center;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
}

.ebook-item img {
    width: 100%;
    height: auto; /* 自适应高度 */
    object-fit: cover;
    margin-bottom: 10px;
    border-radius: 3px;
}

.ebook-item a {
    display: inline-block;
    padding: 5px 10px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    transition: background-color 0.3s;
}

.ebook-item a:hover {
    background-color: #45a049;
}

.ebook-item h3 {
    font-size: 16px;
    margin-bottom: 10px;
}

.ebook-item .ebook-summary {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 10;
    font-family: '仿宋', 'FangSong', 'STFangsong', sans-serif;
    font-size: 14px; /* 小四号字体大小 */
    text-align: left;
    line-height: 1.5;
}

.ebook-item:hover .ebook-summary {
    display: block;
}
/* 分页控件样式 */
.pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.pagination button {
    padding: 5px 10px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.pagination button:hover:not(:disabled),
.pagination button.active {
    background-color: #4CAF50;
    color: white;
}

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


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

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 300px;
    border-radius: 5px;
}

.modal-content h2 {
    margin-top: 0;
}

#new-username-input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}








/* 修改模态框样式 */
.modal-content textarea {
    width: 100%;
    height: 100px;
    margin-top: 10px;
    padding: 5px;
}

