:root {
  --bg: #f6f1e7;
  --surface: #fbf8f1;
  --surface-2: #efe8d8;
  --heading: #2a241d;
  --text: #2a241d;
  --muted: #6e6356;
  --border: #dfd5c2;
  --accent: #7a2e22;
  --accent-soft: rgba(122, 46, 34, 0.1);
  --visited: #8b6fcb;
  --shadow: 0 2px 10px rgba(42, 36, 29, 0.06);
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", Verdana, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --reader-font-size: 18px;
}

html[data-theme="light"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f2f2;
  --heading: #222222;
  --text: #444444;
  --muted: #767676;
  --border: #e5e5e5;
  --accent: #3273dc;
  --accent-soft: rgba(50, 115, 220, 0.08);
  --visited: #8b6fcb;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

html[data-theme="dark"] {
  --bg: #01242e;
  --surface: #01242e;
  --surface-2: #06323f;
  --heading: #eeeeee;
  --text: #dddddd;
  --muted: #98b4bf;
  --border: #12404e;
  --accent: #8cc2dd;
  --accent-soft: rgba(140, 194, 221, 0.14);
  --visited: #8b6fcb;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  word-wrap: break-word;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.15s ease, color 0.15s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  color: var(--heading);
  font-weight: 600;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button, input {
  font-family: var(--font-sans);
}

button {
  margin: 0;
  cursor: pointer;
}

hr {
  border: 0;
  border-top: 1px dashed var(--border);
}

.hidden {
  display: none !important;
}

.view {
  display: none;
  min-height: 100vh;
}

.view.active {
  display: block;
}

/* Header */
.site-header {
  background: var(--bg);
  border-bottom: 1px dashed var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.header-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-tab-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  padding: 4px 11px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 500;
}

.nav-tab-btn:hover {
  color: var(--heading);
  border-color: var(--accent);
}

.nav-tab-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

html[data-theme="dark"] .nav-tab-btn.active {
  color: #01242e;
  font-weight: 600;
}

.brand-mark {
  font-size: 26px;
  color: var(--accent);
  line-height: 1;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.02em;
}

.brand-link {
  color: var(--heading);
  text-decoration: none;
}

.brand-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.subtitle {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-box input {
  width: 220px;
  padding: 6px 10px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px;
}

.search-box input:focus {
  outline: 1.5px solid var(--accent);
  border-color: transparent;
}

.theme-pills {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.theme-pills button {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 4px 9px;
  border-radius: 4px;
  font-size: 12.5px;
}

.theme-pills button.active {
  background: var(--bg);
  color: var(--heading);
  font-weight: 600;
}

/* Library Main */
.library-main {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 20px 56px;
}

.daily-quote-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.daily-quote-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.daily-quote-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.daily-quote-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 12px;
}

.daily-quote-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.daily-quote-text {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--heading);
}

.daily-quote-meta {
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}

.resume-banner {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.resume-info {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.resume-label {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

.resume-chapter {
  font-size: 13.5px;
  color: var(--muted);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border: none;
  padding: 7px 14px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

html[data-theme="dark"] .btn-primary {
  color: #01242e;
  font-weight: 600;
}

.btn-primary:hover {
  opacity: 0.9;
}

.filters-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-right: 4px;
  min-width: 42px;
}

.tab-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 13px;
}

.tab-btn:hover {
  color: var(--heading);
  border-color: var(--accent);
}

.tab-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

html[data-theme="dark"] .tab-btn.active {
  color: #01242e;
  font-weight: 600;
}

.library-stats {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 18px;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.book-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.book-card:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}

.book-collection {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}

.book-title {
  margin: 5px 0 4px;
  font-size: 17px;
  line-height: 1.4;
  color: var(--heading);
}

.book-author {
  font-size: 13px;
  color: var(--muted);
}

.book-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  border-top: 1px dashed var(--border);
  padding-top: 8px;
}

.progress-track {
  height: 3px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
}

.site-footer {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
  padding: 24px 20px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px dashed var(--border);
}

/* Reader View */
.reader-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  border-bottom: 1px dashed var(--border);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.icon-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12.5px;
  white-space: nowrap;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.reader-crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  overflow: hidden;
  white-space: nowrap;
}

.crumb-book {
  font-weight: 600;
  color: var(--heading);
}

.crumb-sep {
  color: var(--muted);
}

.crumb-chap {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.font-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.font-size-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  min-width: 34px;
  text-align: center;
}

.reader-shell {
  display: flex;
  min-height: calc(100vh - 51px);
}

.toc-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--bg);
  border-right: 1px dashed var(--border);
  height: calc(100vh - 51px);
  position: sticky;
  top: 51px;
  overflow-y: auto;
  padding: 18px 14px;
}

.toc-sidebar.collapsed {
  display: none;
}

.toc-header h2 {
  margin: 0 0 4px;
  font-size: 16px;
}

.toc-meta {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--muted);
}

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

.toc-list li button {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 7px 9px;
  border-radius: 5px;
  font-size: 13.5px;
  line-height: 1.45;
}

.toc-list li button:hover {
  background: var(--surface-2);
}

.toc-list li button.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.reader-main {
  flex: 1;
  min-width: 0;
  padding: 32px 24px 72px;
}

.reader-article {
  max-width: 720px;
  margin: 0 auto;
  font-family: var(--font-sans);
  font-size: var(--reader-font-size);
  line-height: 1.78;
}

.reader-article h2 {
  font-size: 1.45em;
  margin: 0 0 1.1em;
  padding-bottom: 0.45em;
  border-bottom: 1px dashed var(--border);
  color: var(--heading);
}

.reader-article h3 {
  font-size: 1.15em;
  margin: 1.6em 0 0.7em;
  color: var(--heading);
}

.reader-article h4 {
  font-size: 1.03em;
  margin: 1.35em 0 0.55em;
  color: var(--accent);
}

.reader-article h5, .reader-article h6 {
  font-size: 0.96em;
  margin: 1.15em 0 0.45em;
  color: var(--muted);
}

.reader-article hr {
  margin: 1.8em 0;
}

.reader-article .table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1.4em 0;
}

.reader-article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
  line-height: 1.6;
}

.reader-article th, .reader-article td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  vertical-align: top;
}

.reader-article th {
  background: var(--surface-2);
  color: var(--heading);
  font-weight: 600;
}

.reader-article tr:nth-child(even) td {
  background: var(--surface);
}

.reader-article p {
  margin: 0 0 1.1em;
}

.reader-article blockquote {
  margin: 1.2em 0;
  padding-left: 18px;
  border-left: 2px solid var(--muted);
  color: var(--muted);
}

.reader-article ul, .reader-article ol {
  padding-left: 1.5em;
  margin: 0 0 1.1em;
}

.reader-article strong, .reader-article b {
  color: var(--heading);
}

.reader-article code {
  font-family: var(--font-mono);
  padding: 2px 4px;
  background-color: var(--surface-2);
  border-radius: 3px;
  font-size: 0.9em;
}

mark {
  background: rgba(255, 213, 79, 0.45);
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
}

.chapter-nav {
  max-width: 720px;
  margin: 40px auto 0;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nav-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 5px;
  font-size: 13.5px;
}

.nav-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.chapter-progress {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}

/* Search Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 72px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modal-card {
  position: relative;
  width: min(680px, 92vw);
  max-height: 75vh;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-head {
  padding: 12px 14px;
  border-bottom: 1px dashed var(--border);
  display: flex;
  gap: 8px;
}

.modal-head input {
  flex: 1;
  padding: 7px 10px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
}

.search-results {
  overflow-y: auto;
  padding: 10px 14px;
}

.search-item {
  padding: 10px 12px;
  border-radius: 5px;
  cursor: pointer;
  border-bottom: 1px dashed var(--border);
}

.search-item:hover {
  background: var(--surface-2);
}

.search-item-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 4px;
}

.search-item-snippet {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 820px) {
  .toc-sidebar {
    position: fixed;
    left: 0;
    top: 51px;
    z-index: 40;
    box-shadow: var(--shadow);
  }
  .reader-crumb .crumb-book {
    display: none;
  }
  .font-size-label {
    display: none;
  }
}

/* Footnotes */
.fn-ref a,
sup a[data-footnote-ref] {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.78em;
  font-weight: 600;
  padding: 0 2px;
}

.fn-ref a:hover,
sup a[data-footnote-ref]:hover {
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.footnotes-section,
section.footnotes {
  margin-top: 2.4em;
  padding-top: 1.1em;
  border-top: 1px dashed var(--border);
  font-size: 0.85em;
  line-height: 1.68;
  color: var(--muted);
}

.footnotes-section h3 {
  margin: 0 0 0.7em;
  font-size: 1em;
  color: var(--heading);
}

.footnotes-list,
section.footnotes ol {
  padding-left: 1.5em;
  margin: 0;
}

.footnotes-list li,
section.footnotes li {
  margin-bottom: 0.5em;
}

.footnotes-list li p,
section.footnotes li p {
  margin: 0 0 0.4em;
}

.fn-back,
.data-footnote-backref {
  color: var(--accent);
  text-decoration: none;
  margin-left: 4px;
}

.fn-popover {
  position: absolute;
  z-index: 60;
  width: min(380px, 90vw);
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
}

.fn-popover-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.fn-popover-close {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
}

/* Two-level TOC */
.toc-group-item {
  margin-bottom: 4px;
}

.toc-group-title {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 9px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
  color: var(--heading);
  cursor: pointer;
  user-select: none;
}

.toc-group-title::-webkit-details-marker {
  display: none;
}

.toc-group-title::before {
  content: "▸";
  font-size: 11px;
  color: var(--muted);
  margin-right: 6px;
  transition: transform 0.15s ease;
}

.toc-group[open] > .toc-group-title::before {
  transform: rotate(90deg);
}

.toc-group-title:hover {
  background: var(--surface-2);
}

.toc-group-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-2);
  padding: 1px 7px;
  border-radius: 999px;
}

.toc-sublist {
  list-style: none;
  margin: 2px 0 6px 12px;
  padding: 0 0 0 8px;
  border-left: 1px dashed var(--border);
}

.toc-sublist li button {
  font-size: 13px;
  padding: 5px 9px;
}

/* Archive View */
.archive-header {
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}

.archive-header h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.archive-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.archive-author-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 20px;
}

.archive-author-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}

.archive-author-name {
  margin: 0;
  font-size: 17px;
  color: var(--heading);
}

.archive-author-meta {
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 500;
}

.archive-works-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.archive-work-btn {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  padding: 7px 10px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14.5px;
}

.archive-work-btn:hover {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--accent);
}

.archive-work-title {
  font-weight: 500;
}

.archive-work-info {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* Changelog View */
.changelog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.changelog-timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.changelog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 16px 20px;
}

.changelog-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.changelog-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cl-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.cl-badge-books {
  background: var(--accent);
  color: #ffffff;
}

html[data-theme="dark"] .cl-badge-books {
  color: #01242e;
}

.cl-badge-proof {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--border);
}

.changelog-date {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}

.changelog-stats {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.changelog-title {
  margin: 0 0 6px;
  font-size: 16.5px;
  line-height: 1.45;
  color: var(--heading);
}

.changelog-summary {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}

.changelog-books {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.changelog-book-pill {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 12.5px;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.changelog-book-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface-2);
}

/* Local Chapter Editor (Vditor) */
.chapter-editor {
  max-width: 820px;
  margin: 0 auto 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 6px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.chapter-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.chapter-editor-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--heading);
}

.chapter-editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.editor-status {
  font-size: 12px;
  color: var(--accent);
}

.vditor-container {
  --panel-background-color: var(--surface);
  --textarea-background-color: var(--bg);
  --textarea-text-color: var(--text);
  --toolbar-background-color: var(--surface-2);
  --border-color: var(--border);
  --hover-background-color: var(--accent-soft);
}

.vditor-container .vditor {
  border-color: var(--border);
  border-radius: 5px;
}

.vditor-container .vditor-toolbar {
  background-color: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.vditor-container .vditor-ir pre.vditor-reset,
.vditor-container .vditor-wysiwyg pre.vditor-reset,
.vditor-container .vditor-sv,
.vditor-container .vditor-preview__action,
.vditor-container .vditor-reset {
  background-color: var(--bg) !important;
  color: var(--text) !important;
  font-family: var(--font-sans) !important;
  font-size: var(--reader-font-size) !important;
  line-height: 1.78 !important;
}

.vditor-container .vditor-reset h1,
.vditor-container .vditor-reset h2,
.vditor-container .vditor-reset h3,
.vditor-container .vditor-reset h4 {
  color: var(--heading) !important;
}

.vditor-container .vditor-reset h1 {
  font-size: 1.45em;
  padding-bottom: 0.4em;
  border-bottom: 1px dashed var(--border);
}

.vditor-container .vditor-reset blockquote {
  border-left-color: var(--muted);
  color: var(--muted);
}

.chapter-editor-textarea {
  width: 100%;
  min-height: 520px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
}

.chapter-editor-textarea:focus {
  outline: 1.5px solid var(--accent);
  border-color: transparent;
}

