/* ============================================================
   尤花殢雪 · 银河档案馆
   科幻编年体 · 9 主题 + 彩蛋
   ============================================================ */

/* ========== 1. 基础重置 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; transition: background 0.3s ease, color 0.2s ease; }
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; }

body {
  line-height: 1.7;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg, #e8edf0);
  color: var(--text-primary, #1a2a35);
}

/* ========== 2. 封面页 ========== */
.cover {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg, #0a0e17);
  cursor: pointer;
  z-index: 1000;
  transition: background 0.5s;
}
.cover-content {
  text-align: center;
  padding: 2rem;
}
.cover-icon {
  font-size: 2.4rem;
  color: var(--accent, #4a9eff);
  opacity: 0.5;
  margin-bottom: 1.2rem;
  letter-spacing: 12px;
}
.cover-title {
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 300;
  letter-spacing: 12px;
  margin-bottom: 1.2rem;
  color: var(--text-primary, #e8edf5);
  font-family: 'Inter', 'PingFang SC', sans-serif;
}
.cover-author {
  font-size: 1.2rem;
  opacity: 0.5;
  font-weight: 300;
  letter-spacing: 6px;
  color: var(--text-secondary, #7a8ea8);
  margin-bottom: 2rem;
}
.cover-epigraph {
  font-size: 1rem;
  font-style: italic;
  opacity: 0.35;
  letter-spacing: 3px;
  color: var(--text-secondary, #7a8ea8);
  margin-bottom: 3rem;
}
.cover-hint {
  font-size: 0.8rem;
  opacity: 0.25;
  letter-spacing: 4px;
  animation: pulse 2.5s infinite;
  color: var(--text-secondary, #7a8ea8);
}
@keyframes pulse {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.4; }
}

/* ========== 3. 主应用布局 ========== */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg, #e8edf0);
}

/* ===== 顶部导航栏 ===== */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: var(--header-bg, rgba(255,255,255,0.85));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 100;
  border-bottom: 1px solid var(--border-light, rgba(0,0,0,0.06));
}
.header-title {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  padding: 0 6px;
  letter-spacing: 0.04em;
  color: var(--text-primary, #1a2a35);
}
.menu-toggle {
  flex-shrink: 0;
  width: 30px;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-primary, #1a2a35);
  cursor: pointer;
  padding: 0;
  text-align: center;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.menu-toggle:hover { opacity: 1; }

/* ===== 主内容区 ===== */
#content {
  margin-top: 52px;
  flex: 1;
  overflow: hidden;
  background: var(--bg, #e8edf0);
}
.page-view {
  display: none;
  height: 100%;
  overflow-y: auto;
  padding: 1.5rem 1.5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.page-view.active { display: block; }

/* ========== 4. 档案馆首页 ========== */
.archive-header {
  text-align: center;
  padding: 1.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border-light, rgba(0,0,0,0.06));
  margin-bottom: 2.5rem;
}
.archive-title {
  font-size: 2.2rem;
  font-weight: 300;
  letter-spacing: 6px;
  color: var(--text-primary, #1a2a35);
  margin-bottom: 0.5rem;
}
.archive-subtitle {
  font-size: 0.95rem;
  opacity: 0.5;
  letter-spacing: 2px;
  color: var(--text-secondary, #4a5a6e);
}
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2.5rem;
}
.archive-card {
  background: var(--card-bg, rgba(255,255,255,0.72));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-light, rgba(0,0,0,0.06));
  border-radius: 12px;
  padding: 1.5rem 1.2rem;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.archive-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent, #0054e3);
  box-shadow: 0 8px 30px rgba(0,84,227,0.08);
}
.archive-card .card-number {
  font-size: 0.7rem;
  opacity: 0.25;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-secondary, #4a5a6e);
  margin-bottom: 0.4rem;
}
.archive-card .card-name {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--text-primary, #1a2a35);
  margin-bottom: 0.4rem;
}
.archive-card .card-count {
  font-size: 0.8rem;
  opacity: 0.4;
  color: var(--text-secondary, #4a5a6e);
}
.archive-footer {
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.3;
  letter-spacing: 1px;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light, rgba(0,0,0,0.06));
  color: var(--text-secondary, #4a5a6e);
}

/* ========== 5. 书首页 ========== */
.book-header {
  padding: 1.2rem 0 1.5rem;
  border-bottom: none;
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.2rem;
  position: relative;
}
.book-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent, #0054e3), var(--accent-soft, #4a9eff), transparent);
  opacity: 0.3;
}
.book-title {
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: 6px;
  color: var(--text-primary, #1a2a35);
  flex: 1;
  min-width: 150px;
}
.book-title .book-title-sub {
  font-size: 0.85rem;
  font-weight: 300;
  opacity: 0.3;
  letter-spacing: 3px;
  margin-left: 0.8rem;
}
.book-count {
  font-size: 0.75rem;
  opacity: 0.2;
  letter-spacing: 2px;
  color: var(--text-secondary, #4a5a6e);
  flex-shrink: 0;
}

/* ===== 书摘 ===== */
.book-epigraph-wrapper {
  padding: 1rem 0 1.8rem;
  border-bottom: 1px solid var(--border-light, rgba(0,0,0,0.04));
  margin-bottom: 1.2rem;
}
.book-epigraph {
  font-size: 1rem;
  font-style: italic;
  opacity: 0.25;
  letter-spacing: 3px;
  color: var(--text-secondary, #4a5a6e);
  text-align: center;
}

/* ===== 书首页卷目录 ===== */
.book-volume-grid {
  display: block;
  width: 100%;
  max-width: 100%;
}
.volume-directory {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.5rem 0;
  width: 100%;
}
.volume-directory-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 0.6rem 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  border-bottom: 1px dashed var(--border-light, rgba(0,0,0,0.04));
  gap: 0;
}
.volume-directory-item:last-child {
  border-bottom: 1px dashed transparent;
}
.volume-directory-item:nth-child(odd) {
  justify-content: flex-start;
}
.volume-directory-item:nth-child(even) {
  justify-content: flex-end;
}
.volume-directory-item .vol-number {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 2px;
  opacity: 0.15;
  color: var(--text-secondary, #4a5a6e);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  transition: opacity 0.3s ease;
}
.volume-directory-item:nth-child(odd) .vol-number {
  order: 0;
  margin-right: 1.2rem;
}
.volume-directory-item:nth-child(even) .vol-number {
  order: 2;
  margin-left: 1.2rem;
}
.volume-directory-item .vol-name {
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--text-primary, #1a2a35);
  transition: color 0.2s ease, letter-spacing 0.2s ease;
  flex-shrink: 0;
}
.volume-directory-item:nth-child(odd) .vol-name {
  order: 1;
}
.volume-directory-item:nth-child(even) .vol-name {
  order: 1;
}
.volume-directory-item .vol-dash {
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    var(--border-light, rgba(0,0,0,0.08)) 0px,
    var(--border-light, rgba(0,0,0,0.08)) 4px,
    transparent 4px,
    transparent 8px
  );
  opacity: 0.2;
  transition: opacity 0.3s ease;
  min-width: 10px;
}
.volume-directory-item:nth-child(odd) .vol-dash {
  order: 2;
  margin-left: 1.2rem;
}
.volume-directory-item:nth-child(even) .vol-dash {
  order: 0;
  margin-right: 1.2rem;
}
.volume-directory-item .vol-arrow {
  font-size: 0.65rem;
  opacity: 0;
  color: var(--accent, #0054e3);
  transition: opacity 0.3s ease, transform 0.3s ease;
  flex-shrink: 0;
}
.volume-directory-item:nth-child(odd) .vol-arrow {
  order: 3;
  margin-left: 0.6rem;
  transform: translateX(-4px);
}
.volume-directory-item:nth-child(even) .vol-arrow {
  order: -1;
  margin-right: 0.6rem;
  transform: translateX(4px);
}
.volume-directory-item .vol-desc {
  font-size: 0.75rem;
  opacity: 0.2;
  color: var(--text-secondary, #4a5a6e);
  letter-spacing: 0.3px;
  line-height: 1.5;
  transition: opacity 0.3s ease;
  flex: 0 1 auto;
  max-width: 45%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.volume-directory-item:nth-child(odd) .vol-desc {
  order: 4;
  margin-left: 1.2rem;
  text-align: left;
}
.volume-directory-item:nth-child(even) .vol-desc {
  order: -2;
  margin-right: 1.2rem;
  text-align: right;
}
.volume-directory-item:hover {
  background: var(--bg, rgba(0,0,0,0.015));
}
.volume-directory-item:hover .vol-number {
  opacity: 0.4;
}
.volume-directory-item:hover .vol-dash {
  opacity: 0.4;
}
.volume-directory-item:hover .vol-arrow {
  opacity: 0.6;
  transform: translateX(0);
}
.volume-directory-item:hover .vol-name {
  letter-spacing: 4px;
  color: var(--accent, #0054e3);
}
.volume-directory-item:hover .vol-desc {
  opacity: 0.4;
}

.book-footer {
  padding: 1.2rem 0 0.2rem;
  border-top: 1px solid var(--border-light, rgba(0,0,0,0.03));
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.65rem;
  opacity: 0.12;
  letter-spacing: 4px;
  color: var(--text-secondary, #4a5a6e);
}

/* ========== 6. 卷首页 ========== */
.volume-header {
  padding: 1rem 0 2rem;
  border-bottom: 1px solid var(--border-light, rgba(0,0,0,0.06));
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.back-btn {
  background: none;
  border: none;
  color: var(--text-secondary, #4a5a6e);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px 0;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.back-btn:hover { opacity: 1; }
.volume-title {
  font-size: 1.8rem;
  font-weight: 300;
  letter-spacing: 4px;
  flex: 1;
  min-width: 150px;
  color: var(--text-primary, #1a2a35);
}
.volume-count {
  font-size: 0.85rem;
  opacity: 0.4;
  letter-spacing: 1px;
  color: var(--text-secondary, #4a5a6e);
}
.volume-description {
  font-size: 0.95rem;
  opacity: 0.4;
  letter-spacing: 1px;
  color: var(--text-secondary, #4a5a6e);
  padding: 0 0 1.5rem 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-light, rgba(0,0,0,0.03));
  line-height: 1.8;
}
.volume-description:empty { display: none; }
.volume-chapter-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.volume-chapter-item {
  display: flex;
  align-items: center;
  padding: 0.7rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-primary, #1a2a35);
  border-left: 3px solid transparent;
}
.volume-chapter-item:hover {
  background: var(--card-bg, rgba(255,255,255,0.5));
  border-left-color: var(--accent, #0054e3);
}
.volume-chapter-item .ch-number {
  font-size: 0.75rem;
  opacity: 0.3;
  width: 3.5rem;
  flex-shrink: 0;
  letter-spacing: 1px;
  color: var(--text-secondary, #4a5a6e);
}
.volume-chapter-item .ch-name {
  font-size: 0.95rem;
  flex: 1;
}

/* ========== 7. 阅读页 ========== */
.reader-view {
  padding: 0;
  max-width: 100%;
}
.reader-view .main-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0 1.5rem;
  max-width: 780px;
  margin: 0 auto;
}
.reader-header {
  padding: 0.8rem 0 0.4rem;
  text-align: center;
  flex-shrink: 0;
}
#chapterTitle {
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 2px;
  opacity: 0.55;
  color: var(--text-secondary, #4a5a6e);
}
.page-container-single {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.page-single {
  max-width: 720px;
  width: 100%;
  padding: 1.5rem 2rem 2rem;
  background: var(--card-bg, rgba(255,255,255,0.72));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  line-height: 1.95;
  font-size: 1.05rem;
  color: var(--text-primary, #1a2a35);
  border-radius: 12px;
  display: block;
  min-height: calc(100% - 1rem);
  height: auto;
  border: 1px solid var(--border-light, rgba(0,0,0,0.04));
}
.page-single h1 {
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: 0.8rem;
  text-align: center;
  letter-spacing: 4px;
  padding-bottom: 1.2rem;
  border-bottom: 2px solid var(--border-light, rgba(0,0,0,0.08));
  color: var(--text-primary, #1a2a35);
}
.page-single h2 {
  font-size: 1.4rem;
  font-weight: 400;
  margin: 2rem 0 1rem;
  opacity: 0.85;
  letter-spacing: 2px;
  padding-left: 0.8rem;
  border-left: 4px solid var(--accent, #0054e3);
  color: var(--text-primary, #1a2a35);
}
.page-single h3 {
  font-size: 1.15rem;
  font-weight: 400;
  margin: 1.6rem 0 0.8rem;
  opacity: 0.8;
  letter-spacing: 1px;
  color: var(--text-primary, #1a2a35);
}
.page-single p {
  margin-bottom: 1.2rem;
  text-indent: 2em;
  word-break: break-word;
  line-height: 1.95;
  color: var(--text-primary, #1a2a35);
}
.page-single ul, .page-single ol {
  margin: 0.8rem 0 1.2rem 1.5rem;
  padding-left: 1rem;
  color: var(--text-primary, #1a2a35);
}
.page-single li { margin-bottom: 0.3rem; line-height: 1.8; text-indent: 0; }
.page-single hr {
  border: none;
  text-align: center;
  margin: 2rem 0;
}
.page-single hr::before {
  content: '✦ ✦ ✦';
  color: var(--border-light, rgba(0,0,0,0.15));
  opacity: 0.4;
  font-size: 0.75rem;
  letter-spacing: 10px;
}
.page-single blockquote {
  border-left: 4px solid var(--accent, #0054e3);
  padding: 0.8rem 1.5rem;
  margin: 1.2rem 0;
  background: var(--bg, rgba(0,0,0,0.02));
  border-radius: 0 4px 4px 0;
  color: var(--text-secondary, #4a5a6e);
}
.page-single code {
  background: var(--bg, rgba(0,0,0,0.04));
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
}
.page-single pre {
  background: var(--bg, rgba(0,0,0,0.03));
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  border: 1px solid var(--border-light, rgba(0,0,0,0.06));
}

/* ===== 章节导航 ===== */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0 1.2rem;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  border-top: 1px solid var(--border-light, rgba(0,0,0,0.06));
  background: var(--bg, #e8edf0);
  flex-shrink: 0;
  gap: 0.5rem;
}
.chapter-nav .nav-left,
.chapter-nav .nav-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.chapter-nav .page-btn {
  background: var(--card-bg, rgba(255,255,255,0.72));
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-light, rgba(0,0,0,0.06));
  color: var(--text-primary, #1a2a35);
  padding: 0.3rem 1rem;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
  border-radius: 6px;
  opacity: 0.5;
}
.chapter-nav .page-btn:hover:not(:disabled) {
  opacity: 0.9;
  border-color: var(--accent, #0054e3);
}
.chapter-nav .page-btn:disabled {
  opacity: 0.12;
  cursor: not-allowed;
}
.chapter-nav .page-indicator {
  font-size: 0.75rem;
  opacity: 0.35;
  letter-spacing: 1px;
  color: var(--text-secondary, #4a5a6e);
}

/* ========== 8. FAB 浮动按钮 ========== */
.fab-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  z-index: 200;
}
.fab-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fab {
  width: 34px;
  height: 34px;
  border: none;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--fab-bg, rgba(255,255,255,0.8));
  backdrop-filter: blur(8px);
  color: var(--fab-color, #1a2a35);
  transition: all 0.2s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  border: 1px solid var(--border-light, rgba(0,0,0,0.04));
}
.fab:hover { transform: scale(1.05); opacity: 0.85; }

/* ========== 9. 侧边栏 ========== */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--sidebar-bg, rgba(255,255,255,0.92));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 300;
  transition: transform 0.25s ease;
  overflow-y: auto;
}
.sidebar-left { left: 0; transform: translateX(-100%); }
.sidebar-right { right: 0; transform: translateX(100%); }
.sidebar.open { transform: translateX(0); }
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light, rgba(0,0,0,0.06));
}
.sidebar-header h3 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary, #1a2a35);
}
.sidebar-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-primary, #1a2a35);
  cursor: pointer;
  padding: 4px;
  opacity: 0.4;
}
.sidebar-content { padding: 14px 16px; }
.sidebar-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 250;
  display: none;
}
.sidebar-overlay.active { display: block; }

.sidebar-section-title {
  font-size: 0.6rem;
  opacity: 0.3;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-secondary, #4a5a6e);
  margin-bottom: 4px;
}
.recent-update {
  padding: 0 0 10px 0;
  border-bottom: 1px solid var(--border-light, rgba(0,0,0,0.05));
  margin-bottom: 10px;
}
.recent-link {
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-primary, #1a2a35);
  transition: opacity 0.15s;
}
.recent-link:hover { opacity: 0.6; text-decoration: underline; text-underline-offset: 3px; }

.toc { flex: 1; padding: 0.2rem 0 1rem; }
.toc a {
  display: block;
  padding: 0.25rem 0.8rem;
  color: var(--text-primary, #1a2a35);
  text-decoration: none;
  font-size: 0.82rem;
  transition: all 0.15s;
  opacity: 0.6;
  border-left: 3px solid transparent;
}
.toc a:hover {
  opacity: 1;
  border-left-color: var(--accent, #0054e3);
  background: var(--bg, rgba(0,0,0,0.02));
}
.toc .toc-section {
  padding: 0.4rem 0.8rem;
  font-size: 0.7rem;
  opacity: 0.4;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  color: var(--text-secondary, #4a5a6e);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.15s;
  border-left: 3px solid transparent;
}
.toc .toc-section:hover { opacity: 0.7; }
.toc .toc-section.open { opacity: 0.7; border-left-color: var(--accent, #0054e3); }
.toc .toc-arrow {
  display: inline-block;
  font-size: 0.5rem;
  opacity: 0.5;
  width: 14px;
  text-align: center;
}
.toc .toc-children {
  padding-left: 0.5rem;
  border-left: 1px solid var(--border-light, rgba(0,0,0,0.05));
  margin-left: 0.5rem;
}
.toc .toc-file {
  display: block;
  padding: 0.25rem 0.8rem 0.25rem 0.5rem;
  color: var(--text-primary, #1a2a35);
  text-decoration: none;
  font-size: 0.82rem;
  transition: all 0.15s;
  opacity: 0.6;
  border-left: 3px solid transparent;
}
.toc .toc-file:hover {
  opacity: 1;
  border-left-color: var(--accent, #0054e3);
  background: var(--bg, rgba(0,0,0,0.02));
}
.menu-footer {
  text-align: center;
  padding: 12px 0;
  font-size: 10px;
  opacity: 0.15;
  cursor: pointer;
  user-select: none;
  border-top: 1px solid var(--border-light, rgba(0,0,0,0.05));
  margin-top: 8px;
  color: var(--text-secondary, #4a5a6e);
  transition: opacity 0.2s;
  letter-spacing: 4px;
}
.menu-footer:hover { opacity: 0.4; }

#themeList {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.theme-option {
  padding: 10px 14px;
  cursor: pointer;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-primary, #1a2a35);
  background: var(--card-bg, rgba(255,255,255,0.6));
  backdrop-filter: blur(4px);
  border: 1px solid var(--border-light, rgba(0,0,0,0.04));
  transition: all 0.15s;
}
.theme-option:hover {
  border-color: var(--accent, #0054e3);
  background: var(--bg, rgba(0,0,0,0.02));
}

#tocContent a {
  display: block;
  padding: 5px 12px;
  color: var(--text-secondary, #4a5a6e);
  text-decoration: none;
  font-size: 13px;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
#tocContent a:hover {
  color: var(--text-primary, #1a2a35);
  border-left-color: var(--accent, #0054e3);
  background: var(--bg, rgba(0,0,0,0.02));
}
#tocContent .toc-h1 { padding-left: 0; font-weight: 500; }
#tocContent .toc-h2 { padding-left: 16px; }
#tocContent .toc-h3 { padding-left: 32px; font-size: 12px; opacity: 0.7; }
#tocContent .toc-h4 { padding-left: 48px; font-size: 11px; opacity: 0.6; }

/* ========== 10. Toast ========== */
.toast-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--card-bg, rgba(255,255,255,0.9));
  backdrop-filter: blur(16px);
  color: var(--text-primary, #1a2a35);
  padding: 14px 28px;
  border-radius: 12px;
  z-index: 9999;
  font-size: 15px;
  font-weight: 500;
  pointer-events: none;
  animation: toastFade 2s forwards;
  border: 1px solid var(--border-light, rgba(0,0,0,0.06));
  box-shadow: 0 8px 40px rgba(0,0,0,0.08);
}
@keyframes toastFade {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.94); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  85% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.94); }
}

/* ========== 11. 移动端适配 ========== */
@media (max-width: 768px) {
  .page-view { padding: 1rem 1rem 1.5rem; }
  .archive-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.8rem; }
  .archive-card { padding: 1.2rem 0.8rem; }
  .archive-title { font-size: 1.6rem; }
  .volume-title { font-size: 1.4rem; }

  .reader-view .main-content { padding: 0 0.8rem; }
  .page-single { padding: 1rem 1.2rem 1.5rem; font-size: 0.95rem; }
  .page-single h1 { font-size: 1.4rem; }
  .page-single h2 { font-size: 1.15rem; }

  .chapter-nav { padding: 0.6rem 0 1rem; gap: 0.3rem; flex-wrap: wrap; justify-content: center; }
  .chapter-nav .page-btn { padding: 0.2rem 0.7rem; font-size: 0.7rem; }
  .chapter-nav .page-indicator { font-size: 0.65rem; }
  .chapter-nav .nav-left, .chapter-nav .nav-right { gap: 0.2rem; }

  #header { height: 46px; padding: 0 10px; }
  .header-title { font-size: 13px; }
  #content { margin-top: 46px; }

  .fab { width: 30px; height: 30px; font-size: 13px; }
  .fab-container { bottom: 16px; right: 16px; }
  .sidebar { width: 260px; max-width: 82vw; }

  .cover-title { font-size: clamp(2.2rem, 8vw, 3.5rem); letter-spacing: 6px; }
  .cover-epigraph { font-size: 0.85rem; }

  .volume-chapter-item { padding: 0.5rem 0.8rem; }
  .volume-chapter-item .ch-number { width: 2.8rem; font-size: 0.65rem; }
  .volume-chapter-item .ch-name { font-size: 0.85rem; }

  .volume-directory-item {
    flex-wrap: wrap;
    justify-content: flex-start !important;
    padding: 0.5rem 0.3rem;
  }
  .volume-directory-item .vol-desc {
    max-width: 100%;
    white-space: normal;
    flex: 0 0 100%;
    order: 10 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: calc(4.2rem + 0.8rem);
    text-align: left !important;
    font-size: 0.7rem;
    opacity: 0.25;
  }
  .volume-directory-item:nth-child(even) .vol-number {
    order: 0;
    margin-right: 0.8rem;
    margin-left: 0;
  }
  .volume-directory-item:nth-child(even) .vol-dash {
    order: 2;
    margin-left: 0.8rem;
    margin-right: 0;
  }
  .volume-directory-item:nth-child(even) .vol-arrow {
    order: 3;
    margin-left: 0.4rem;
    margin-right: 0;
    transform: translateX(-4px);
  }
  .volume-directory-item:nth-child(even) .vol-name {
    order: 1;
  }
  .volume-directory-item:hover .vol-arrow { transform: translateX(0); }
  .volume-directory-item .vol-number { font-size: 0.6rem; min-width: 3.6rem; }
  .volume-directory-item .vol-name { font-size: 0.9rem; }
  .volume-directory-item .vol-dash { min-width: 6px; }
}

/* ============================================================
   14. 模拟恐怖（彩蛋）
   ============================================================ */

body.theme-analoghorror {
  --bg: #050508;
  --card-bg: #0a0a12;
  --text-primary: #b0b8c0;
  --text-secondary: #7a8088;
  --border-light: rgba(255,0,51,0.15);
  --border-glow: #ff0033;
  --accent: #ff0033;
  --accent-soft: #ff4466;
  --fab-bg: #000000;
  --fab-color: #ff0033;
  --header-bg: #050508;
  --sidebar-bg: #050508;
  --link-color: #ff2244;

  background-color: #050508;
  color: #b0b8c0;
  font-family: 'Courier New', 'Consolas', monospace !important;
  position: relative;
  overflow-x: hidden;
}
body.theme-analoghorror::before {
  content: '';
  position: fixed;
  top: -10px; left: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiPjxyZWN0IHdpZHRoPSI4IiBoZWlnaHQ9IjgiIGZpbGw9IiMwMDAiLz48cGF0aCBkPSJNMCAwaDh2OEgweiIgZmlsbD0ibm9uZSIvPjxwYXRoIGQ9Ik0wIDBoMXYxSDB6TTIgMGgxdjFIMnpNNCAwaDF2MUg0ek02IDBoMXYxSDZ6TTAgMmgxdjFIMHpNMiAyaDF2MUgyek00IDJoMXYxSDR6TTYgMmgxdjFINnpNMCA0aDF2MUgwek0yIDRoMXYxSDJ6TTQgNGgxdjFINEpNNiA0aDF2MUg2ek0wIDZoMXYxSDB6TTIgNmgxdjFIMnpNNCA2aDF2MUg0ek02IDZoMXYxSDZ6IiBmaWxsPSIjZmZmIiBvcGFjaXR5PSIwLjA2Ii8+PC9zdmc+');
  background-repeat: repeat;
  background-size: 8px 8px;
  opacity: 0.15;
  pointer-events: none;
  z-index: 9998;
  animation: analog-noise 0.15s steps(4) infinite;
}
@keyframes analog-noise {
  0% { transform: translate(0,0); }
  20% { transform: translate(-2px,1px); }
  40% { transform: translate(2px,-1px); }
  60% { transform: translate(-1px,2px); }
  80% { transform: translate(1px,-2px); }
  100% { transform: translate(0,0); }
}
body.theme-analoghorror::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px, rgba(0,0,0,0.15) 2px, rgba(0,0,0,0.15) 4px);
  pointer-events: none;
  z-index: 9999;
}
body.theme-analoghorror .page-single {
  border: 1px solid #ff0033;
  background: rgba(6,6,14,0.92);
}
body.theme-analoghorror .archive-card {
  border: 1px solid rgba(255,0,51,0.15);
  background: rgba(6,6,14,0.5);
}
body.theme-analoghorror .archive-card:hover { border-color: #ff0033; }
body.theme-analoghorror .fab { border: 1px solid #ff0033; color: #ff0033; background: #000; }
body.theme-analoghorror .sidebar { background: #050508; border-right: 1px solid #ff0033; }
body.theme-analoghorror #header { border-bottom: 1px solid #ff0033; }
body.theme-analoghorror .chapter-nav .page-btn { border: 1px solid rgba(255,0,51,0.2); background: #0a0a12; color: #b0b8c0; }
body.theme-analoghorror .chapter-nav .page-btn:hover:not(:disabled) { border-color: #ff0033; }
body.theme-analoghorror .header-title { color: #ff0033 !important; text-shadow: 0 0 20px rgba(255,0,51,0.3); }
body.theme-analoghorror .volume-directory-item .vol-name { color: #b0b8c0; }
body.theme-analoghorror .volume-directory-item:hover .vol-name { color: #ff0033; }

.menu-links-row {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--border-dark, var(--border-glow));
}

/* Unified local line icons for interface controls. */
.ui-icon-slot,.ui-icon {display:inline-flex;width:1.05em;height:1.05em;vertical-align:-.16em;flex:0 0 auto;}
.ui-icon {fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;}
button .ui-icon {pointer-events:none;}
.menu-toggle [data-icon],.header-home [data-icon] {display:inline-flex;width:18px;height:18px;align-items:center;justify-content:center;}
.header-home {display:inline-flex;align-items:center;justify-content:center;}
.archive-search .ui-icon {width:17px;height:17px;}
.fab .ui-icon {width:17px;height:17px;}
.sidebar-header h3 .ui-icon-slot {width:16px;height:16px;}
.sidebar-close {display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;}
.sidebar-close .ui-icon {width:15px;height:15px;}
.sidebar-section-title .ui-icon {width:12px;height:12px;opacity:.9;margin-right:4px;}
.menu-link-icon {display:inline-flex;align-items:center;justify-content:center;}
.menu-link-icon .ui-icon {width:17px;height:17px;}
.back-btn .ui-icon-slot,.page-btn .ui-icon-slot {width:14px;height:14px;}
.chapter-nav .page-btn {display:inline-flex;align-items:center;gap:7px;}
.theme-option-main {display:flex;align-items:center;gap:9px;}
.theme-icon {display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;color:var(--accent);}
.theme-icon .ui-icon {width:17px;height:17px;}
.theme-option small {margin-left:29px;}
.theme-option .ui-icon {vertical-align:middle;}
.toast-message {display:flex;align-items:center;gap:10px;}
.toast-message>.ui-icon {width:18px;height:18px;color:var(--accent);flex:0 0 auto;}
.toc .toc-arrow {display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;}
.toc-arrow .ui-icon {width:9px;height:9px;}
.card-enter .ui-icon {width:12px;height:12px;margin-left:3px;}
.ui-icon-slot:empty {min-width:1em;}


/* 桌面端隐藏浏览器视口原生滚动条，保留滚轮、键盘与触控板滚动。 */
@media screen and (min-width: 769px) {
  html {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  html::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
}
