/**
 * 原创小说阅读器：左侧目录 + 单章正文 + 上一篇/下一篇
 */
body.qmt-theme-openclaw .qmt-novel-reader-page .qmt-main {
  max-width: none;
}

body.qmt-theme-openclaw .qmt-novel-reader .qmt-novel-reader__head {
  position: relative;
  margin-bottom: 1rem;
}

body.qmt-theme-openclaw .qmt-novel-toc-toggle {
  display: none;
  margin-top: 10px;
}

body.qmt-theme-openclaw .qmt-novel-reader__layout {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

body.qmt-theme-openclaw .qmt-novel-toc {
  flex: 0 0 260px;
  width: 260px;
  max-height: calc(100vh - 180px);
  position: sticky;
  top: 78px;
}

body.qmt-theme-openclaw .qmt-novel-toc__inner {
  background: #f0f5f9;
  border: 1px solid rgba(59, 91, 122, 0.14);
  border-radius: 12px;
  padding: 14px 12px;
  max-height: calc(100vh - 180px);
  overflow: auto;
}

body.qmt-theme-openclaw .qmt-novel-toc__title {
  margin: 0 0 10px;
  padding: 0 6px 8px;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  border-bottom: 1px solid rgba(59, 91, 122, 0.12);
}

body.qmt-theme-openclaw .qmt-novel-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

body.qmt-theme-openclaw .qmt-novel-toc__item {
  margin: 0 0 4px;
}

body.qmt-theme-openclaw .qmt-novel-toc__link {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #334155;
  text-decoration: none;
  line-height: 1.45;
  transition: background 0.15s ease, color 0.15s ease;
}

body.qmt-theme-openclaw .qmt-novel-toc__link:hover {
  background: rgba(212, 175, 55, 0.12);
  color: #0f172a;
  text-decoration: none;
}

body.qmt-theme-openclaw .qmt-novel-toc__item.is-active .qmt-novel-toc__link {
  background: rgba(212, 175, 55, 0.18);
  color: #0f172a;
  font-weight: 700;
  box-shadow: inset 3px 0 0 #d4af37;
}

body.qmt-theme-openclaw .qmt-novel-toc__seq {
  flex: 0 0 auto;
  min-width: 1.5em;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}

body.qmt-theme-openclaw .qmt-novel-toc__item.is-active .qmt-novel-toc__seq {
  color: #b8860b;
}

body.qmt-theme-openclaw .qmt-novel-toc__name {
  flex: 1 1 auto;
  font-size: 13px;
  word-break: break-word;
}

body.qmt-theme-openclaw .qmt-novel-main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 1.25rem 1.35rem;
  background: #f0f5f9;
  border-radius: 12px;
  border: 1px solid rgba(59, 91, 122, 0.14);
  text-align: left;
}

body.qmt-theme-openclaw .qmt-novel-section__head {
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(59, 91, 122, 0.12);
}

body.qmt-theme-openclaw .qmt-novel-section__title {
  margin: 0 0 0.5rem;
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}

body.qmt-theme-openclaw .qmt-novel-meta {
  font-size: 14px;
  color: #475569;
}

body.qmt-theme-openclaw .qmt-novel-meta strong {
  color: #0f172a;
  font-weight: 700;
}

body.qmt-theme-openclaw .qmt-novel-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 17px;
  line-height: 1.8;
  font-weight: 500;
  color: #0f172a;
}

body.qmt-theme-openclaw .qmt-novel-body.qmt-novel-body--richtext {
  white-space: normal;
}

body.qmt-theme-openclaw .qmt-novel-body.qmt-novel-body--richtext p {
  margin: 0 0 0.75em 0;
}

body.qmt-theme-openclaw .qmt-novel-body.qmt-novel-body--richtext p:last-child {
  margin-bottom: 0;
}

body.qmt-theme-openclaw .qmt-novel-body.qmt-novel-body--richtext h1,
body.qmt-theme-openclaw .qmt-novel-body.qmt-novel-body--richtext h2,
body.qmt-theme-openclaw .qmt-novel-body.qmt-novel-body--richtext h3,
body.qmt-theme-openclaw .qmt-novel-body.qmt-novel-body--richtext h4 {
  color: #0f172a;
  font-weight: 700;
  margin: 1.1em 0 0.5em 0;
  line-height: 1.35;
}

body.qmt-theme-openclaw .qmt-novel-body.qmt-novel-body--richtext h1:first-child,
body.qmt-theme-openclaw .qmt-novel-body.qmt-novel-body--richtext h2:first-child,
body.qmt-theme-openclaw .qmt-novel-body.qmt-novel-body--richtext h3:first-child,
body.qmt-theme-openclaw .qmt-novel-body.qmt-novel-body--richtext h4:first-child {
  margin-top: 0;
}

body.qmt-theme-openclaw .qmt-novel-body.qmt-novel-body--richtext img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

body.qmt-theme-openclaw .qmt-novel-body.qmt-novel-body--richtext table {
  max-width: 100%;
  border-collapse: collapse;
}

body.qmt-theme-openclaw .qmt-novel-body.qmt-novel-body--richtext a {
  color: #2563eb;
  text-decoration: underline;
}

body.qmt-theme-openclaw .qmt-novel-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(59, 91, 122, 0.12);
}

body.qmt-theme-openclaw .qmt-novel-pager__btn {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(59, 91, 122, 0.16);
  background: #fff;
  color: #0f172a;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.qmt-theme-openclaw a.qmt-novel-pager__btn:hover {
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  text-decoration: none;
  color: #0f172a;
}

body.qmt-theme-openclaw .qmt-novel-pager__btn--next {
  text-align: right;
  margin-left: auto;
}

body.qmt-theme-openclaw .qmt-novel-pager__btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.55);
}

body.qmt-theme-openclaw .qmt-novel-pager__dir {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #b8860b;
  text-transform: uppercase;
}

body.qmt-theme-openclaw .qmt-novel-pager__title {
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

body.qmt-theme-openclaw .qmt-novel-empty {
  padding: 2rem;
  text-align: center;
  color: #334155;
  font-size: 16px;
  font-weight: 600;
  background: #f0f5f9;
  border-radius: 12px;
  border: 1px solid rgba(59, 91, 122, 0.14);
}

@media (max-width: 991px) {
  body.qmt-theme-openclaw .qmt-novel-toc-toggle {
    display: inline-block;
  }

  body.qmt-theme-openclaw .qmt-novel-reader__layout {
    flex-direction: column;
  }

  body.qmt-theme-openclaw .qmt-novel-toc {
    width: 100%;
    flex: none;
    position: relative;
    top: auto;
    max-height: none;
    display: none;
  }

  body.qmt-theme-openclaw .qmt-novel-toc.is-open {
    display: block;
  }

  body.qmt-theme-openclaw .qmt-novel-toc__inner {
    max-height: 50vh;
  }

  body.qmt-theme-openclaw .qmt-novel-pager__btn--next {
    text-align: left;
    margin-left: 0;
  }
}
