body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f8f9fa;
  color: #1a1a2e;
  padding-top: 70px;
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 1.4rem;
  margin-right: 1.5rem;
}

.navbar-brand i {
  color: #ffc107;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
}

.nav-link.active {
  border-bottom: 3px solid #ffc107;
}

.navbar-nav {
  gap: 0.25rem;
}

.paper-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.book-hero {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.5rem;
  align-items: center;
}

.book-cover {
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  background: linear-gradient(150deg, #16162b 0%, #2b2b52 55%, #3d3d6b 100%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.6rem 1.4rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.book-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 15%, rgba(255, 193, 7, 0.28), transparent 55%);
}

.book-cover .cover-top {
  font-size: 0.72rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.book-cover .cover-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  position: relative;
  z-index: 1;
}

.book-cover .cover-title span {
  display: block;
  color: #ffc107;
  font-size: 1rem;
  margin-top: 0.4rem;
  font-weight: 500;
}

.book-cover .cover-author {
  font-size: 0.95rem;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.book-cover .cover-author small {
  display: block;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.book-title {
  font-size: 2.3rem;
  font-weight: 700;
  line-height: 1.25;
  color: #0a0a23;
  margin-bottom: 0.5rem;
}

.book-subtitle {
  font-size: 1.1rem;
  color: #495057;
  margin-bottom: 1.25rem;
}

.book-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.9rem;
  color: #495057;
  margin-bottom: 1.5rem;
}

.book-meta i {
  color: #6c757d;
  margin-right: 0.3rem;
}

.book-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-read {
  background: #ffc107;
  border: none;
  color: #1a1a2e;
  font-weight: 600;
  padding: 0.65rem 1.5rem;
  border-radius: 30px;
}

.btn-read:hover {
  background: #e0a800;
  color: #1a1a2e;
}

.btn-toc {
  border: 1px solid #ced4da;
  color: #495057;
  font-weight: 600;
  padding: 0.65rem 1.5rem;
  border-radius: 30px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title i {
  color: #ffc107;
}

.annotation {
  font-size: 1.02rem;
  line-height: 1.7;
  color: #343a40;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-list li {
  border-bottom: 1px solid #eef0f2;
}

.toc-list li:last-child {
  border-bottom: none;
}

.toc-list a {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  padding: 0.7rem 0.5rem;
  text-decoration: none;
  color: #212529;
  border-radius: 8px;
  transition: background 0.15s, padding-left 0.15s;
}

.toc-list a:hover {
  background: #fff8e1;
  padding-left: 0.9rem;
}

.toc-num {
  flex: 0 0 2.2rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #adb5bd;
  text-align: right;
}

.toc-list a:hover .toc-num {
  color: #e0a800;
}

.toc-title {
  flex: 1;
}

.toc-arrow {
  color: #ced4da;
  opacity: 0;
  transition: opacity 0.15s;
}

.toc-list a:hover .toc-arrow {
  opacity: 1;
}

.chapter-label {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #e0a800;
  margin-bottom: 0.4rem;
}

.chapter-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  color: #0a0a23;
  margin-bottom: 1.25rem;
}

.chapter-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #2b2b3a;
}

.chapter-content p {
  text-align: justify;
  margin-bottom: 1.1rem;
}

.chapter-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0a0a23;
  margin: 2rem 0 1rem;
}

.chapter-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0a0a23;
  margin: 1.6rem 0 0.8rem;
}

.chapter-content strong {
  color: #0a0a23;
}

.chapter-content h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0a0a23;
  margin: 1.4rem 0 0.6rem;
}

.chapter-content h5 {
  font-size: 0.98rem;
  font-weight: 700;
  color: #343a40;
  margin: 1.2rem 0 0.5rem;
}

.chapter-content ul,
.chapter-content ol {
  margin-bottom: 1.1rem;
}

.chapter-content li {
  margin-bottom: 0.35rem;
}

.chapter-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.chapter-content .book-table {
  width: 100%;
  margin: 1.25rem 0;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.chapter-content .book-table td,
.chapter-content .book-table th {
  border: 1px solid #e6e8eb;
  padding: 0.4rem 0.6rem;
  vertical-align: top;
}

.chapter-content .book-table tr:nth-child(even) td {
  background: #fbfbfc;
}

.book-preface {
  font-size: 1.02rem;
  line-height: 1.75;
  color: #2b2b3a;
}

.book-preface p {
  margin-bottom: 1rem;
}

.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eef0f2;
}

.chapter-nav .nav-prev,
.chapter-nav .nav-next {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.85rem 1rem;
  border: 1px solid #e6e8eb;
  border-radius: 12px;
  text-decoration: none;
  color: #212529;
  transition: all 0.15s;
}

.chapter-nav .nav-next {
  text-align: right;
}

.chapter-nav .nav-prev:hover,
.chapter-nav .nav-next:hover {
  border-color: #ffc107;
  background: #fffdf5;
}

.chapter-nav .nav-hint {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #adb5bd;
  margin-bottom: 0.2rem;
}

.chapter-nav .nav-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.chapter-nav .nav-disabled {
  visibility: hidden;
}

.toc-sidebar {
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

.toc-sidebar .toc-sidebar-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.toc-sidebar .toc-sidebar-title i {
  color: #ffc107;
}

.toc-sidebar .toc-link {
  display: flex;
  gap: 0.6rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.9rem;
  color: #495057;
  text-decoration: none;
  border-radius: 6px;
  line-height: 1.35;
}

.toc-sidebar .toc-link:hover {
  background: #fff8e1;
}

.toc-sidebar .toc-link.active {
  background: #ffc107;
  color: #1a1a2e;
  font-weight: 600;
}

.toc-sidebar .toc-link .num {
  flex: 0 0 1.4rem;
  text-align: right;
  color: #adb5bd;
  font-variant-numeric: tabular-nums;
}

.toc-sidebar .toc-link.active .num {
  color: #1a1a2e;
}

footer {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

footer a {
  color: #ffc107;
  text-decoration: none;
}

@media (max-width: 767.98px) {
  .book-hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .book-cover {
    max-width: 220px;
    margin: 0 auto;
  }

  .book-title {
    font-size: 1.8rem;
  }

  .chapter-title {
    font-size: 1.55rem;
  }

  .chapter-nav {
    flex-direction: column;
  }

  .chapter-nav .nav-next {
    text-align: left;
  }

  .toc-sidebar {
    position: static;
    max-height: none;
  }
}
