/* 主页面样式 */
body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background-color: #181818;
  color: #fff;
  overflow: hidden;
}

/* 警告容器 */
.nsfw-warning {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nsfw-warning .warning-backdrop {
  position: fixed;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    rgba(115, 115, 9, 0.85),
    rgba(115, 115, 9, 0.85) 80px,
    rgba(0, 0, 0, 0.85) 80px,
    rgba(0, 0, 0, 0.85) 160px
  );
}

.glitch-snow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

.glitch-cluster {
  position: absolute;
  opacity: 0;
  filter: blur(0.8px);
  animation: glitch-fade 3s linear forwards;
}

.glitch-cluster span {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: rgb(255, 255, 255);
  border-radius: 50%;
  animation: glitch-move 2s ease-in-out infinite alternate;
}

@keyframes glitch-fade {
  0%, 100% { opacity: 0; }
  10%, 90% { opacity: 0.7; }
}

@keyframes glitch-move {
  0% { transform: translate(0, 0); }
  100% { transform: translate(5px, -5px); }
}

.nsfw-warning .warning-content {
  position: relative;
  max-width: 600px;
  padding: 30px;
  background-color: rgba(0, 0, 0, 0.7);
  border: 2px solid #ffd700;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  z-index: 11;
}

.warning-title {
  color: #ffd700;
  border-bottom: 2px solid #ffd700;
  padding-bottom: 10px;
  margin-top: 0;
}

.warning-text {
  font-size: 18px;
  line-height: 1.6;
}

.warning-note {
  font-size: 14px;
  color: #ccc;
  font-style: italic;
}

.enter-button {
  display: block;
  margin: 20px auto 0;
  padding: 10px 20px;
  background-color: #ffd700;
  color: #000;
  border: none;
  border-radius: 5px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.enter-button:hover {
  background-color: #fff;
  transform: scale(1.05);
}

/* 主内容区域：左侧列表+右侧详情布局 */
.main-content {
  display: none;
  position: relative;
  z-index: 5;
  height: calc(100vh - 130px);
  margin-top: 60px;
  padding: 30px;
  box-sizing: border-box;
}

/* 年份选择框：右上角 */
.year-selector {
  position: fixed;
  top: 20px;
  right: 40px;
  z-index: 8;
}

.year-selector select {
  padding: 6px 9px;
  font-size: 16px;
  border-radius: 4px;
  background-color: #333;
  color: #fff;
  cursor: pointer;
}

.year-selector select option {
  background-color: #333;
}

.year-title {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #ffd700;
  font-size: 28px;
  margin: 0;
}

/* 左侧书籍列表 */
.books-list {
  width: 300px;
  height: 100%;
  background-color: #222;
  border-radius: 8px;
  padding: 15px;
  overflow-y: auto;
  box-sizing: border-box;
  float: left;
}

/* 自定义滚动条样式 */
.books-list::-webkit-scrollbar { width: 8px; }
.books-list::-webkit-scrollbar-track { background: #333; border-radius: 4px; }
.books-list::-webkit-scrollbar-thumb { background: #555; border-radius: 4px; }
.books-list::-webkit-scrollbar-thumb:hover { background: #777; }

.books-list-title {
  color: #ffd700;
  font-size: 20px;
  margin-top: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid #444;
  padding-bottom: 10px;
}

/* 书籍列表项：默认样式+选中动画 */
.book-item {
  background-color: #333;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

/* 选中项动画：放大+阴影 */
.book-item.active {
  transform: scale(1.03);
  background-color: #3a3a00;
  box-shadow: 0 0 15px rgba(85, 72, 1, 0.6);
  border: 1px solid #ffd700;
}

.book-item:hover:not(.active) {
  background-color: #3a3a3a;
}

.book-item-name {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 3px;
}

.book-item-brief {
  font-size: 13px;
  color: #ccc;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 右侧详情框 */
.book-detail {
  margin-left: 318px;
  height: 100%;
  background-color: #222;
  border-radius: 8px;
  padding: 30px;
  box-sizing: border-box;
  border: 1px solid #393627;
  box-shadow: 0 0 20px rgba(28, 28, 25, 0.3);
  cursor: zoom-in;
  overflow-y: auto;
}

/* 详情框内部布局：左侧图片，右侧文字 */
.detail-inner {
  display: flex;
  gap: 30px;
  height: 100%;
}

.detail-image-container {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: auto;
  margin-bottom: auto;
  margin-left: 30px;
}

/* 书籍图片样式：固定高度，保持原始比例 */
.detail-image {
  height: 450px;
  width: auto;
  object-fit: contain;
  border-radius: 8px;
  border: 1x solid #68684f7e;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  max-width: 330px;
  background-color: #111;
}

.detail-image-placeholder {
  width: 330px;
  height: 450px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px dashed #555;
  border-radius: 8px;
  color: #888;
  font-style: italic;
}

.detail-content {
  flex: 1;
  overflow-y: auto;
}

.book-detail-title {
  color: #ffd700;
  font-size: 28px;
  margin-top: 28px;
  margin-bottom: 20px;
  border-bottom: 2px solid #444;
  padding-bottom: 10px;
}

.book-detail-description {
  font-size: 16px;
  line-height: 1.8;
  color: #eee;
}

/* 时间轴区域：底部固定，文字禁止选中 */
.timeline-wrapper {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  z-index: 7;
  user-select: none;
  -webkit-user-select: none;
}

.timeline {
  position: relative;
  width: 100%;
  height: 60px;
  overflow: hidden;
}

.timeline-track {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: #444;
  transform: translateY(-50%);
  z-index: 1;
}

.timeline-years {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  display: flex;
  gap: 40px;
  transition: left 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
  white-space: nowrap;
  z-index: 2;
}

.timeline-year {
  color: #fff;
  font-size: 18px;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  position: relative;
  z-index: 3;
}

.timeline-year:hover, .timeline-year.active {
  background-color: #ffd700;
  color: #000;
  font-weight: bold;
}

/* 关于按钮 */
.about-button {
  position: fixed;
  top: 20px;
  left: 38px;
  z-index: 9;
  outline: none;
  cursor: pointer;
  border: none;
  padding: 0.5rem 2rem;
  border: 2px solid #ffd700;
  margin: 0;
  font-family: inherit;
  font-size: 17px;
  letter-spacing: 0.05rem;
  font-weight: 700;
  border-radius: 500px;
  overflow: hidden;
  background: #ffd700;
  color: ghostwhite;
}

.about-button span {
  position: relative;
  z-index: 10;
  transition: color 0.4s;
}

.about-button:hover span {
  color: black;
}

.about-button::before,
.about-button::after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.about-button::before {
  content: "";
  background: #000;
  width: 120%;
  left: -10%;
  transform: skew(30deg);
  transition: transform 0.4s cubic-bezier(0.3, 1, 0.8, 1);
}

.about-button:hover::before {
  transform: translate3d(100%, 0, 0);
}

/* 移除重复的timeline-wrapper样式定义 */
/* 搜索结果页面样式 */
.search-query-display {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #222;
  padding: 10px 20px;
  border-radius: 6px;
  z-index: 8;
}

.search-query-display h3 {
  color: #ffd700;
  margin: 0;
  font-size: 16px;
}

/* 书籍详情补充样式 */
.book-detail-year {
  color: #ffd700;
  margin: 10px 0;
  font-size: 14px;
}

.book-detail-contributors,
.book-detail-editors {
  margin: 8px 0;
  font-size: 14px;
}

.contributor-link,
.editor-link {
  color: #4CAF50;
  text-decoration: none;
  transition: color 0.3s ease;
}

.contributor-link:hover,
.editor-link:hover {
  color: #66BB6A;
  text-decoration: underline;
}

/* 确保主内容区域可见 */
.main-content {
  display: block !important;
  position: relative;
  z-index: 5;
  height: calc(100vh - 130px);
  margin-top: 60px;
  padding: 30px;
  box-sizing: border-box;
}

/* 确保书籍列表和详情区域正确显示 */
.books-list {
  width: 300px;
  height: 100%;
  background-color: #222;
  border-radius: 8px;
  padding: 15px;
  overflow-y: auto;
  box-sizing: border-box;
  float: left;
}

.book-detail {
  margin-left: 330px;
  height: 100%;
  background-color: #222;
  border-radius: 8px;
  overflow-y: auto;
}

.search-result .main-content {
  height: calc(100vh - 100px);
  margin-top: 80px;
}

.search-result .timeline-wrapper {
  display: none;
}

.search-query-display h3 {
    color: #ffd700;
    margin: 0;
    font-size: 1.2rem;
}

.back-button {
    padding: 8px 16px;
    background-color: #ffd700;
    color: #000;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.back-button:hover {
    background-color: #e5c100;
    transform: translateY(-2px);
}

.no-results, .error-message, .no-selection {
    color: #ffd700;
    text-align: center;
    padding: 40px 20px;
    font-style: italic;
}

.error-message {
    color: #ff4444;
}

#loadingIndicator {
    color: #ffd700;
    text-align: center;
    padding: 40px 20px;
}

.book-detail {
    height: 100%;
    overflow-y: auto;
    padding: 0 10px;
}

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

.book-cover {
    flex-shrink: 0;
}

.book-cover img {
    max-width: 150px;
    height: auto;
    border: 2px solid #ffd700;
}

.book-info {
    flex: 1;
}

.book-info p {
    margin: 10px 0;
    line-height: 1.6;
}

.contributor-link, .editor-link {
    color: #ffd700;
    text-decoration: underline;
    cursor: pointer;
}

.contributor-link:hover, .editor-link:hover {
    color: #e5c100;
}

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

.read-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #ffd700;
    color: #000;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.read-button:hover {
    background-color: #e5c100;
    transform: translateY(-2px);
}