:root {
  --bg-color: #f8f9fa;
  --text-color: #333;
  --sidebar-bg: #fff;
  --sidebar-hover: #f1f3f5;
  --accent-color: #0d6efd;
  --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  --transition-speed: 0.3s;
}

.dark-mode {
  --bg-color: #212529;
  --text-color: #f8f9fa;
  --sidebar-bg: #343a40;
  --sidebar-hover: #495057;
  --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

html {
  scrollbar-width: none;
  /* Firefox 隐藏滚动条 */
  -ms-overflow-style: none;
  /* IE/Edge 隐藏滚动条 */
}

/* Chrome/Safari 隐藏滚动条 */
.html::-webkit-scrollbar {
  display: none;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color var(--transition-speed), color var(--transition-speed);
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.8;
  height: 100vh;
}

button {
  outline: none;
}

button:focus {
  outline: none;
  box-shadow: none!important;
}

.page-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.navbar {
  width: 100%;
}

.app-container {
  height: calc(100vh - 62px);
  overflow-y: auto;
}

.sidebar {
  width: 320px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  transition: all var(--transition-speed);
  height: calc(100vh - 62px);
  overflow-y: auto;
}

.content-area {
  width: calc(100% - 320px);
  height: 100%;
  overflow-y: auto;
  padding: 2rem;
}

.chapter-item {
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.chapter-item:hover {
  background-color: var(--sidebar-hover);
}

.chapter-item.active {
  background-color: rgba(13, 110, 253, 0.1);
  border-left: 3px solid var(--accent-color);
}

.subchapter {
  max-height: 0;
  padding-left: 1rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-speed) ease-out;
}

.subchapter a {
  color: var(--text-color);
}

.subchapter.expanded {
  max-height: 100%;
  transition: max-height 0.3s ease-in;
}

.subchapter.expanded a.active,
.subchapter.expanded a.active small {
  color: #0d6efd;
}

.chapter-content {
  /* display: none; */
  animation: fadeIn 0.5s ease-in-out;
}

/* .chapter-content.active {
  display: block;
} */

.chapter-title {
  font-weight: 700;
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.chapter-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: var(--accent-color);
}

.nav-control {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
}

.font-controls {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 100;
}

.control-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--card-shadow);
  transition: transform var(--transition-speed);
}

.control-btn:hover {
  transform: scale(1.1);
}

/* .progress-container {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  width: 1200px;
  height: 3px;
  background: transparent;
  z-index: 1050;
} */

.progress-bar {
  height: 3px;
  background: var(--accent-color);
  width: 0%;
}

.chapter-content p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.chapter-content img {
  max-width: 100%;
  height: auto;
  margin: 2rem auto;
  display: block;
  border-radius: 4px;
  box-shadow: var(--card-shadow);
}

.chapter-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.chapter-content blockquote {
  border-left: 4px solid var(--accent-color);
  padding-left: 1rem;
  margin-left: 0;
  font-style: italic;
  color: #6c757d;
}


/* 三级目录缩进 */
.subchapter .subchapter {
  padding-left: 1rem;
}

/* 三级目录项样式 */
.chapter-item .chapter-item {
  padding: 0.5rem 0;
}

/* 三级目录激活状态 */
.chapter-item.active {
  background-color: rgba(13, 110, 253, 0.1);
  border-left: 3px solid var(--accent-color);
}

/* 三级目录hover状态 */
.chapter-item:hover {
  background-color: var(--sidebar-hover);
}

.text-color-w {
  color: #f8f9fa!important;
}


@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    z-index: 1050;
    width: 80%;
    left: -85%;
    top: 56px;
    height: calc(100vh - 56px);
  }

  .sidebar.show {
    left: 0;
  }

  .content-area {
    width: 100%;
    padding: 1rem;
  }

  .mobile-overlay {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
  }

  .mobile-overlay.show {
    display: block;
  }
  
  a.navbar-brand span {
    font-size: 16px;
  }
}





/* 文章详情 */
#box {
  width: 600px;
  margin: 10;
  text-align: left;
  border-width: 2px;
  border-color: black;
  border-style: solid;
  font-size: 14px;
}

@media (max-width: 632px) {
  #box {width: 100%}
}

#content {
  background-color: #FFFFFF;
  border-radius: 8px;
  box-shadow: 1px 1px 1px #ccc;
  border: 1px solid #EEEEEE;
}

#btn {
  width: 80px;
}

#spread {
  height: 0px;
  overflow: hidden;
}





/* 添加搜索功能 */
.sidebar-search,
.sidebar-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-form {
  width: calc(100% - 45px);
  position: relative;
}

.sidebar-form input {
  width: 100%;
  font-size: 16px;
  padding: 5px 30px 5px 10px;
}

.sidebar-form button {
  background: none;
  border: none;
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
}






















