/* ===== 图书馆背景容器 ===== */
.library-bg {
  min-height: calc(100vh - 60px);
  background-image: url('images/library-bg.jpg'); 
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  padding: 30px 40px;
  gap: 30px;
  position: relative;
}

/* 暗色遮罩 */
.library-bg::before {
  content: '';
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(10, 10, 15, 0.4);
  z-index: 0;
}

/* ===== 左侧目录栏 ===== */
.glass-sidebar {
  width: 320px;
  flex-shrink: 0;
  background: rgba(20, 20, 30, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  z-index: 1;
  height: calc(100vh - 120px);
}

.glass-sidebar h2 {
  color: var(--accent);
  font-size: 1.4rem;
  margin-bottom: 16px;
  font-family: "yyb", serif;
  border-bottom: 1px solid rgba(201, 162, 39, 0.3);
  padding-bottom: 10px;
}

.sort-box select {
  width: 100%;
  padding: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(201, 162, 39, 0.3);
  color: var(--text-color);
  border-radius: 6px;
  outline: none;
  margin-bottom: 12px;
  font-family: 'Saira', sans-serif;
}

/* 紧凑的导入按钮 */
.compact-import {
  background: rgba(201, 162, 39, 0.1);
  border: 1px dashed rgba(201, 162, 39, 0.5);
  border-radius: 6px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 16px;
  color: var(--accent);
  font-size: 0.85rem;
  transition: 0.2s;
}
.compact-import:hover { background: rgba(201, 162, 39, 0.2); }

.file-list {
  list-style: none;
  overflow-y: auto;
  flex-grow: 1;
}
.file-list::-webkit-scrollbar { width: 6px; }
.file-list::-webkit-scrollbar-thumb { background: rgba(201, 162, 39, 0.3); border-radius: 3px; }

.file-list li {
  padding: 12px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
  border-left: 3px solid transparent;
}
.file-list li:hover { background: rgba(201, 162, 39, 0.15); }
.file-list li.active {
  border-left-color: var(--accent);
  background: rgba(201, 162, 39, 0.2);
}
.file-list .file-name { color: #fff; font-size: 0.9rem; margin-bottom: 4px; display: block; font-weight: bold; }
.file-list .file-meta { color: #aaa; font-size: 0.75rem; display: flex; justify-content: space-between; }
.empty-hint { color: #aaa; text-align: center; cursor: default; background: transparent !important; }

/* ===== 右侧阅读区 ===== */
.glass-reader {
  flex-grow: 1;
  background: rgba(20, 20, 30, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  overflow: hidden;
}

.reader-header {
  padding: 16px 32px;
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
  background: rgba(0, 0, 0, 0.2);
}
.reader-header h2 { color: var(--accent); font-size: 1.4rem; }

.reader-content {
  flex: 1;
  overflow-y: auto;
  padding: 40px 60px;
  color: var(--text-color);
  font-family: 'Saira', "yyb", serif;
  font-size: 1.05rem;
  line-height: 1.9;
}

.empty-reader {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%; color: #888;
}
.empty-reader h3 { color: var(--accent); font-size: 2rem; margin-bottom: 10px; }

/* 排版 */
.reader-content h1 { color: var(--accent); text-align: center; margin-bottom: 1.5em; font-size: 2.2rem; }
.reader-content h2 { color: var(--accent); margin-top: 1.5em; margin-bottom: 0.8em; }
.reader-content h3 { color: var(--accent); margin-top: 1.2em; margin-bottom: 0.6em; }
.reader-content p { margin-bottom: 1.2em; text-indent: 2em; }
.reader-content blockquote { border-left: 4px solid var(--accent); padding-left: 16px; color: #aaa; margin: 1em 0; background: rgba(201, 162, 39, 0.05); }
.reader-content img { max-width: 100%; border-radius: 8px; margin: 16px 0; box-shadow: 0 4px 15px rgba(0,0,0,0.5); }

/* 手机端 */
@media (max-width: 800px) {
  .library-bg { flex-direction: column; padding: 20px; height: auto; }
  .glass-sidebar { width: 100%; height: 300px; }
  .glass-reader { height: 600px; }
  .reader-content { padding: 20px; }
}