/* TokenCheap tutorial shell. The article body remains HonKit-native; this file
   owns the shared sidebar and its three local preview themes. */
.book {
  --tc-sidebar-width: 324px;
  --tc-sidebar-bg: #f8f9fc;
  --tc-sidebar-panel: #fff;
  --tc-sidebar-ink: #17202e;
  --tc-sidebar-muted: #8894a7;
  --tc-sidebar-line: #e5e9f1;
  --tc-sidebar-accent: #5a55f7;
}

.book-summary {
  width: var(--tc-sidebar-width) !important;
  background: var(--tc-sidebar-bg);
  border-right: 1px solid var(--tc-sidebar-line);
  color: var(--tc-sidebar-ink);
}

.book.with-summary .book-body { left: var(--tc-sidebar-width) !important; }

.tokencheap-native-brand {
  display: block;
  height: 78px;
  padding: 6px 20px;
  border-bottom: 1px solid var(--tc-sidebar-line);
  background: var(--tc-sidebar-panel);
  text-align: center;
}

.tokencheap-native-brand img {
  width: 190px;
  height: 64px;
  object-fit: contain;
}

.book-summary #book-search-input {
  margin: 14px 14px 2px;
  padding: 0;
  border: 1px solid var(--tc-sidebar-line);
  border-radius: 12px;
  background: var(--tc-sidebar-panel);
}

.book-summary #book-search-input input {
  height: 42px;
  padding: 0 14px;
  color: var(--tc-sidebar-ink);
  font-size: 13px;
}

.book-summary #book-search-input input::placeholder { color: var(--tc-sidebar-muted); }
.book-summary ul.summary { padding: 0 12px 54px; }
.book-summary ul.summary li { list-style: none; }

.book-summary ul.summary li.sidebar-section-title {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
  margin: 22px 4px 9px;
  padding: 0 6px 10px;
  border-bottom: 1px solid var(--tc-sidebar-line);
}

.book-summary ul.summary li.sidebar-section-title span {
  grid-column: 1 / -1;
  color: var(--tc-sidebar-accent);
  font: 700 10px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .16em;
}

.book-summary ul.summary li.sidebar-section-title strong {
  color: var(--tc-sidebar-ink);
  font-size: 16px;
  line-height: 24px;
}

.book-summary ul.summary li.sidebar-section-title small {
  align-self: center;
  color: var(--tc-sidebar-muted);
  font-size: 11px;
}

.book-summary ul.summary li.header {
  display: grid;
  grid-template-columns: 27px 1fr auto;
  gap: 7px;
  align-items: center;
  margin: 13px 4px 5px;
  padding: 5px 6px;
  color: var(--tc-sidebar-ink);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.book-summary ul.summary li.header span {
  color: var(--tc-sidebar-accent);
  font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.book-summary ul.summary li.header strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-summary ul.summary li.header small {
  min-width: 23px;
  padding: 2px 6px;
  border: 1px solid var(--tc-sidebar-line);
  border-radius: 999px;
  color: var(--tc-sidebar-muted);
  font-size: 10px;
  text-align: center;
}

.book-summary ul.summary li.chapter > a {
  position: relative;
  display: block;
  margin: 2px 0;
  padding: 9px 12px 9px 20px;
  border-radius: 9px;
  color: #566174;
  font-size: 13px;
  line-height: 1.45;
}

.book-summary ul.summary li.chapter > a:hover {
  background: rgba(90, 85, 247, .06);
  color: var(--tc-sidebar-ink);
  text-decoration: none;
}

.book-summary ul.summary li.chapter.active > a {
  background: rgba(90, 85, 247, .09);
  color: var(--tc-sidebar-accent);
  font-weight: 700;
}

.book-summary ul.summary li.chapter.active > a::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 5px;
  width: 3px;
  border-radius: 3px;
  background: var(--tc-sidebar-accent);
  content: "";
}

.book-summary ul.summary li.chapter[data-level="1.1"] > a {
  margin-top: 12px;
  color: var(--tc-sidebar-ink);
  font-weight: 700;
}

.book-summary .gitbook-link { color: var(--tc-sidebar-muted); }
.markdown-section img { height: auto; }
.markdown-section a[href="https://wzyp.cn/shop/2M7DOCNQ"] { font-weight: 600; }
.native-search-empty { padding: 12px 20px; color: var(--tc-sidebar-muted); font-size: 13px; }

/* Style B: rounded content cards with a stronger editorial hierarchy. */
.book[data-sidebar-style="cards"] {
  --tc-sidebar-width: 348px;
  --tc-sidebar-bg: #f2f5ff;
  --tc-sidebar-panel: #fff;
  --tc-sidebar-ink: #18213a;
  --tc-sidebar-muted: #7885a0;
  --tc-sidebar-line: #dce3f3;
  --tc-sidebar-accent: #6657ff;
}

.book[data-sidebar-style="cards"] .book-summary ul.summary { padding-right: 15px; padding-left: 15px; }

.book[data-sidebar-style="cards"] .book-summary ul.summary li.sidebar-section-title {
  margin-top: 18px;
  padding: 13px 14px;
  border: 1px solid var(--tc-sidebar-line);
  border-radius: 14px;
  background: linear-gradient(135deg, #fff 0%, #f7f6ff 100%);
  box-shadow: 0 8px 24px rgba(51, 61, 101, .06);
}

.book[data-sidebar-style="cards"] .book-summary ul.summary li.header {
  margin-top: 18px;
  padding: 0 8px;
}

.book[data-sidebar-style="cards"] .book-summary ul.summary li.chapter > a {
  margin: 6px 0;
  padding: 11px 14px;
  border: 1px solid var(--tc-sidebar-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 3px 12px rgba(51, 61, 101, .035);
}

.book[data-sidebar-style="cards"] .book-summary ul.summary li.chapter.active > a {
  border-color: rgba(102, 87, 255, .32);
  background: #fff;
  box-shadow: 0 8px 24px rgba(102, 87, 255, .12);
}

.book[data-sidebar-style="cards"] .book-summary ul.summary li.chapter.active > a::before { display: none; }

/* Style C: dark, compact focus mode for long reading sessions. */
.book[data-sidebar-style="dark"] {
  --tc-sidebar-width: 324px;
  --tc-sidebar-bg: #111827;
  --tc-sidebar-panel: #172033;
  --tc-sidebar-ink: #f2f5fb;
  --tc-sidebar-muted: #8f9bb0;
  --tc-sidebar-line: #283348;
  --tc-sidebar-accent: #42d7b7;
}

.book[data-sidebar-style="dark"] .tokencheap-native-brand img {
  padding: 3px 12px;
  border-radius: 10px;
  background: #fff;
}

.book[data-sidebar-style="dark"] .book-summary #book-search-input { box-shadow: inset 0 0 0 1px rgba(255,255,255,.02); }
.book[data-sidebar-style="dark"] .book-summary ul.summary li.chapter > a { color: #b8c1d1; }
.book[data-sidebar-style="dark"] .book-summary ul.summary li.chapter > a:hover { background: rgba(255,255,255,.06); color: #fff; }
.book[data-sidebar-style="dark"] .book-summary ul.summary li.chapter.active > a { background: rgba(66, 215, 183, .12); color: #74efd4; }
.book[data-sidebar-style="dark"] .book-summary ul.summary li.header small { background: rgba(255,255,255,.03); }

.native-book-title {
  display: block;
  height: 50px;
  padding: 0 20px;
  overflow: hidden;
  color: #7e888b;
  font-size: 14px;
  line-height: 50px;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.book-header .honkit-page-title {
  margin: 0;
  padding-right: 200px;
  padding-left: 200px;
  overflow: hidden;
  color: inherit;
  font-size: 20px;
  font-weight: 200;
  line-height: 50px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .2s ease;
}

.book-header .honkit-page-title a,
.book-header .honkit-page-title a:hover { color: inherit; text-decoration: none; }
.book-header:hover .honkit-page-title { opacity: 1; }

.native-article-meta {
  margin-top: 3em !important;
  color: #9a9a9a;
  font-size: 13px;
}

@media screen and (max-width: 1000px) {
  .book-header .honkit-page-title { display: none; }
}

@media (max-width: 600px) {
  .tokencheap-native-brand { height: 66px; }
  .tokencheap-native-brand img { width: 170px; height: 54px; }
  /* Mobile always starts on the article; the summary overlays it as a drawer. */
  .book.with-summary .book-body { left: 0 !important; transform: none !important; }
  .book-summary { width: min(88vw, var(--tc-sidebar-width)) !important; }
}

@media print {
  .tokencheap-native-brand { display: none; }
}
