* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #f5f5f5;
  font-family: "SimSun", "Microsoft YaHei", sans-serif;
  transition: all 0.3s ease;
}

.reader {
  max-width: 800px;
  margin: 20px auto;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: max-width 0.3s ease;
  position: relative;
}

.header {
  background-color: #2563eb;
  color: white;
  padding: 16px;
  text-align: center;
  font-size: 1.2em;
  border-radius: 8px 8px 0 0;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background-color: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.toolbar button {
  padding: 6px 12px;
  background-color: #4f46e5;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 6px;
}

.toolbar button:hover {
  background-color: #4338ca;
}

.toolbar button:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
}

.toolbar select {
  padding: 6px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  margin-right: 6px;
}

.progress {
  text-align: center;
  padding: 8px;
  color: #6b7280;
  font-size: 0.9em;
}

.content {
  padding: 24px;
  line-height: 1.8;
  min-height: 500px;
  color: #000;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.content h2 {
  text-align: center;
  margin-bottom: 24px;
  color: inherit;
}

.content p {
  text-indent: 2em;
  margin-bottom: 1em;
}

.toc-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.toc-content {
  background-color: white;
  width: 300px;
  max-height: 80%;
  overflow-y: auto;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.toc-content h3 {
  margin-bottom: 8px;
}

#toc-range {
  margin: 8px 0;
  width: 100%;
  cursor: pointer;
}

.toc-list {
  list-style-type: none;
}

.toc-list li {
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
  cursor: pointer;
}

.toc-list li:hover {
  color: #2563eb;
}

.reader.narrow {
  max-width: 600px;
}

.reader.wide {
  max-width: 1000px;
}

.reader.fullscreen {
  max-width: 100vw;
  margin: 0;
  border-radius: 0;
}

.theme-default {
  background-color: white;
  color: #000;
}

.theme-eye {
  background-color: #f5f5dc;
  color: #556b2f;
}

.theme-red {
  background-color: #ffe4e1;
  color: #b22222;
}

.theme-green {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.theme-blue {
  background-color: #e3f2fd;
  color: #1565c0;
}

.theme-purple {
  background-color: #f3e5f5;
  color: #6a1b9a;
}

.theme-cyan {
  background-color: #e0f7fa;
  color: #00838f;
}

.theme-black {
  background-color: #121212;
  color: #fff;
}

.text-white {
  color: #fff;
}

.text-black {
  color: #000;
}

.bottom-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 99;
}

.bottom-nav button {
  padding: 8px 16px;
  background-color: #4f46e5;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.bottom-nav button:hover {
  background-color: #4338ca;
}

/* 修复回到顶部按钮样式 */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background-color: #4f46e5;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
  text-decoration: none;
  line-height: 1;
}

.back-to-top.show {
  opacity: 1;
}