/* ==========================================================================
   学习：科目卡 + 个人卡 + 详情（树 / 文件）+ 阅读
   沿用主站 token：暖纸、墨色、靛蓝强调、18px 圆角、发丝线。
   ========================================================================== */

.st-wrap { padding-bottom: 72px; }

/* ---------------------------------------------------------------- 列表 */
.st-head .page-desc { max-width: 64ch; }

.st-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}

.st-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.st-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 22px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-1);
  transition: transform .22s var(--ease), border-color .22s ease, box-shadow .22s ease;
}

.st-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-2);
}

.st-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.st-card-top { display: flex; gap: 12px; align-items: flex-start; }

.st-avatar-mark {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-family: var(--font-serif, Georgia, serif);
  font-size: 19px;
  font-weight: 700;
  color: #33403a;
  background: linear-gradient(150deg, #E7EFE4, #DCE8DC);
  border: 1px solid rgba(23, 21, 15, .06);
}

[data-theme="dark"] .st-avatar-mark { color: #d7e3d4; background: linear-gradient(150deg, #24332d, #1e2b27); }

.st-card h2 {
  margin: 0 0 4px;
  font-size: 19px;
  letter-spacing: -.01em;
  line-height: 1.3;
}

.st-card-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  font-size: 12.5px;
  color: var(--ink-3);
}

.st-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }

.st-types { display: flex; flex-wrap: wrap; gap: 6px; }

.st-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--ink-3);
}

.st-type i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .75; }

.st-type--pdf { color: #A5452F; }
.st-type--md { color: #2C5F8D; }
.st-type--img { color: #4C7A57; }
.st-type--doc { color: #7A5A2E; }

.st-recent {
  margin: 0;
  padding: 12px 0 0;
  list-style: none;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 7px;
}

.st-recent li {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--ink-2);
}

.st-recent li span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.st-recent time {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.st-card-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--ink-3);
}

.st-go { color: var(--accent); font-weight: 600; }

.st-note {
  margin: 16px 2px 0;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-3);
}

.st-note svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; }

/* ---------------------------------------------------------------- 个人卡 */
.st-profile {
  position: sticky;
  top: 88px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.st-profile-head {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 22px 22px 18px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(253, 239, 221, .85) 0%, rgba(253, 239, 221, 0) 62%),
    var(--bg-2);
}

.st-profile-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 3px solid var(--bg-2);
  box-shadow: 0 6px 18px -8px rgba(23, 21, 15, .45);
  background: linear-gradient(150deg, #DCE5EE, #C9D8E6);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 30px;
  font-weight: 700;
  color: #2C5F8D;
}

.st-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.st-profile-head h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; }

.st-profile-head p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-3);
}

.st-profile-body { padding: 16px 22px 20px; }

.st-meta {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.st-meta li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}

.st-meta li:last-child { border-bottom: 0; padding-bottom: 0; }

.st-meta span { color: var(--ink-3); }
.st-meta b { font-weight: 600; text-align: right; }

.st-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 13px 0;
  margin-bottom: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.st-stats div { text-align: center; }
.st-stats b { display: block; font-size: 22px; letter-spacing: -.02em; }
.st-stats span { font-size: 11.5px; color: var(--ink-3); }

.st-bio {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-3);
}

.st-links { display: grid; gap: 8px; }

.st-links a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
  transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}

.st-links a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft, rgba(44, 95, 141, .08)); }

/* ---------------------------------------------------------------- 面包屑 */
.st-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--ink-3);
}

.st-crumbs a { color: var(--accent); text-decoration: none; }
.st-crumbs a:hover { text-decoration: underline; }
.st-crumbs svg { width: 12px; height: 12px; opacity: .55; }

/* ---------------------------------------------------------------- 详情 */
.st-detail {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.st-tree {
  position: sticky;
  top: 88px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  box-shadow: var(--shadow-1);
}

.st-tree h2 {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.st-tree ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }

.st-tree ul ul { margin-left: 12px; padding-left: 10px; border-left: 1px solid var(--line); }

.st-tree a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--ink-2);
  text-decoration: none;
}

.st-tree a:hover { background: var(--bg-3); color: var(--ink); }

.st-tree a[aria-current="true"] {
  background: var(--accent-soft, rgba(44, 95, 141, .1));
  color: var(--accent);
  font-weight: 600;
}

.st-tree svg { width: 14px; height: 14px; flex: 0 0 auto; opacity: .55; }

.st-count { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }

.st-files {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.st-files-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.st-files-head h2 { margin: 0; font-size: 17px; letter-spacing: -.01em; }

.st-sub { font-size: 12.5px; color: var(--ink-3); }

.st-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  min-width: 200px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-3);
}

.st-search svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--ink-3); }

.st-search input {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  outline: none;
}

.st-search kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
}

.st-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.st-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink-3);
  cursor: pointer;
  transition: border-color .16s ease, color .16s ease, background-color .16s ease;
}

.st-chip:hover { border-color: var(--line-strong); color: var(--ink); }

.st-chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg-2);
}

.st-folder-list, .st-list { margin: 0; padding: 0; list-style: none; }

.st-folder-list li { border-bottom: 1px solid var(--line); }

.st-folder-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  color: inherit;
  text-decoration: none;
}

.st-folder-list a:hover { background: var(--bg-3); }
.st-folder-list svg { width: 16px; height: 16px; opacity: .6; }
.st-folder-list b { font-size: 14px; font-weight: 600; }
.st-folder-list span { margin-left: auto; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }

.st-file { border-bottom: 1px solid var(--line); }
.st-file:last-child { border-bottom: 0; }

.st-file > a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 13px 18px;
  color: inherit;
  text-decoration: none;
  transition: background-color .16s ease;
}

.st-file > a:hover { background: var(--bg-3); }
.st-file > a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.st-badge {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid transparent;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .02em;
}

.st-badge--pdf { background: #FAEDE8; color: #A5452F; border-color: #EFD8CF; }
.st-badge--md { background: #EAF2F8; color: #2C5F8D; border-color: #D6E4F0; }
.st-badge--img { background: #EDF4EC; color: #4C7A57; border-color: #DCE9DA; }
.st-badge--doc { background: #F7F0E3; color: #7A5A2E; border-color: #EBDFC9; }

[data-theme="dark"] .st-badge--pdf { background: #3a2521; color: #e4a08c; border-color: #4d312b; }
[data-theme="dark"] .st-badge--md { background: #1e2e3d; color: #9dc4e6; border-color: #2a3f52; }
[data-theme="dark"] .st-badge--img { background: #23302a; color: #a6c9a8; border-color: #2f4038; }
[data-theme="dark"] .st-badge--doc { background: #33290f; color: #d3b483; border-color: #453718; }

.st-file-main { min-width: 0; }

.st-file-main b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
}

.st-file-main span { font-size: 12px; color: var(--ink-3); }

.st-size, .st-date {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
}

.st-empty { padding: 40px 20px; text-align: center; font-size: 13.5px; color: var(--ink-3); }

/* ---------------------------------------------------------------- 阅读 */
.st-reader {
  max-width: 760px;
  margin: 0 auto;
  padding: 30px 34px 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  box-shadow: var(--shadow-1);
}

.st-reader-head { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }

.st-reader-head h1 {
  margin: 12px 0 10px;
  font-size: clamp(26px, 3.4vw, 34px);
  letter-spacing: -.025em;
  line-height: 1.25;
}

.st-reader-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12.5px;
  color: var(--ink-3);
}

.st-reader-meta a { color: var(--accent); }

.st-prose { font-size: 18px; line-height: 1.95; }
.st-prose h2 { margin: 1.8em 0 .7em; font-size: 24px; letter-spacing: -.02em; }
.st-prose h3 { margin: 1.6em 0 .6em; font-size: 19.5px; }
.st-prose p { margin: 0 0 1.1em; }
.st-prose ul, .st-prose ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.st-prose li { margin: .3em 0; }
.st-prose blockquote {
  margin: 1.2em 0;
  padding: 2px 0 2px 16px;
  border-left: 2px solid var(--accent);
  color: var(--ink-2);
}
.st-prose pre {
  margin: 1.1em 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-3);
  overflow: auto;
  font-size: 13.5px;
  line-height: 1.7;
}
.st-prose code { font-family: var(--font-mono); font-size: .92em; }
.st-prose hr { margin: 2em 0; border: 0; border-top: 1px solid var(--line); }

.st-figure { margin: 0; }
.st-figure img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }
.st-figure figcaption { margin-top: 10px; text-align: center; font-size: 12.5px; color: var(--ink-3); }

.st-pdf object {
  width: 100%;
  height: min(78vh, 880px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-3);
}

.st-pdf-fallback { padding: 40px 20px; text-align: center; }

.st-download {
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  text-align: center;
  background: var(--bg-3);
}

.st-download p { margin: 0 0 12px; font-size: 14px; color: var(--ink-2); }

.st-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
}

.st-btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.st-btn:hover { transform: translateY(-1px); }

.st-hint { margin: 12px 0 0; font-size: 12.5px; color: var(--ink-3); }

.st-empty-page {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-3);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.st-empty-page h1, .st-empty-page h2 { margin: 0 0 10px; color: var(--ink); }
.st-empty-page code { font-family: var(--font-mono); font-size: .92em; }

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1000px) {
  .st-layout { grid-template-columns: minmax(0, 1fr) 288px; gap: 22px; }
  .st-grid { grid-template-columns: 1fr; }
  .st-detail { grid-template-columns: 200px minmax(0, 1fr); gap: 18px; }
}

@media (max-width: 780px) {
  .st-layout { grid-template-columns: minmax(0, 1fr); }
  .st-profile { position: static; order: -1; }
  .st-detail { grid-template-columns: minmax(0, 1fr); }
  .st-tree { position: static; }
  .st-search { margin-left: 0; width: 100%; }
  .st-file > a { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .st-date { display: none; }
  .st-reader { padding: 22px 18px 30px; }
  .st-prose { font-size: 17px; }
  .st-pdf object { height: 62vh; }
}

@media (prefers-reduced-motion: reduce) {
  .st-card, .st-links a, .st-chip, .st-btn { transition: none; }
  .st-card:hover { transform: none; }
}

/* 学习页代码块：沿用主题的 .code-block 结构，但换成纸上配色 */
.st-prose .code-block {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.st-prose .code-block pre,
.st-prose .code-block code {
  color: var(--ink);
  background: transparent;
}

.st-prose .code-block .tok-k { color: #2C5F8D; }
.st-prose .code-block .tok-s { color: #A5452F; }
.st-prose .code-block .tok-c { color: var(--ink-3); }
.st-prose .code-block .tok-n { color: #6B4E8F; }
.st-prose .code-lang,
.st-prose .code-copy { color: var(--ink-3); }

[data-theme="dark"] .st-prose .code-block .tok-k { color: #7fb4e3; }
[data-theme="dark"] .st-prose .code-block .tok-s { color: #e8b27f; }
[data-theme="dark"] .st-prose .code-block .tok-n { color: #c9a7e8; }
/* 学习页表格（Obsidian 笔记里用得很多） */
.st-prose table {
  width: 100%;
  margin: 1.2em 0;
  border-collapse: collapse;
  font-size: 15.5px;
  line-height: 1.7;
}

.st-prose th,
.st-prose td {
  padding: 9px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.st-prose th {
  background: var(--bg-3);
  font-weight: 600;
  white-space: nowrap;
}

.st-prose tbody tr:nth-child(even) td {
  background: rgba(23, 21, 15, .018);
}

@media (max-width: 780px) {
  .st-prose table { font-size: 14px; }
  .st-prose th, .st-prose td { padding: 7px 8px; }
}
/* ==========================================================================
   阅读页：与笔记页一致的左侧目录 + 更宽正文 + 长文性能
   ========================================================================== */

.st-doc {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 44px;
  max-width: 1180px;
  margin: 0 auto;
  align-items: start;
}

.st-doc .st-toc {
  position: sticky;
  top: 92px;
  align-self: start;
  font-size: 13.5px;
  line-height: 1.65;
}

.st-doc .st-toc[hidden] { display: none; }

.st-doc .st-reader {
  max-width: none;
  width: 100%;
  margin: 0;
}

/* 目录层级：h2 顶层，h3 缩进，h4 再缩进 */
.toc ul ul {
  margin-left: 12px;
  border-left-color: var(--line);
}

.toc .toc-h4 a {
  padding-left: 34px;
  font-size: 12.4px;
  color: var(--ink-3);
}

/* 长文档：不在视口内的段落跳过布局与绘制 */
.st-prose > * {
  content-visibility: auto;
  contain-intrinsic-size: auto 44px;
}

.st-prose table,
.st-prose pre,
.st-prose blockquote {
  contain-intrinsic-size: auto 120px;
}

@media (max-width: 1180px) {
  .st-doc {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .st-doc .st-toc {
    position: static;
    padding-bottom: 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--line);
    max-height: 40vh;
    overflow: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .st-prose > * { content-visibility: visible; }
}
/* 目录条目多时（长文档最多 89 条）：限高 + 内部滚动，不撑破视口 */
@media (min-width: 1181px) {
  .st-doc .st-toc {
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 6px;
  }

  .st-doc .st-toc::-webkit-scrollbar { width: 6px; }
  .st-doc .st-toc::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 3px;
  }
}

/* 正文再宽一档（原来 760 → 现在约 900） */
.st-doc {
  max-width: 1240px;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 36px;
}

.st-doc .st-reader {
  max-width: 920px;
}

.st-doc .st-prose {
  font-size: 18px;
  line-height: 1.95;
}
/* 公式占位：渲染前保留内联高度，避免滚动跳动 */
.st-tex {
  display: inline-block;
  min-width: 1.2em;
  min-height: 1.1em;
  vertical-align: baseline;
}

.st-tex--block {
  display: block;
  margin: 1.1em 0;
  text-align: center;
  min-height: 2.2em;
}

.st-tex--raw {
  font-family: var(--font-mono);
  font-size: .92em;
  color: var(--ink-2);
  white-space: pre-wrap;
}

.st-tex .katex { font-size: 1.02em; }
/* 阅读页放宽：只在存在目录（阅读视图）时把外层容器加宽 */
.st-wrap:has(.st-doc) {
  width: min(1340px, calc(100% - 48px));
}

.st-doc .st-reader {
  max-width: 980px;
}

.st-doc .st-prose {
  max-width: none;
}

/* 列表页维持原来的两列宽度 */
.st-layout {
  max-width: 1180px;
  margin-inline: auto;
}
/* 阅读视图把外层容器放宽（用 body class，避免依赖 :has） */
body.wyl-study-reader .st-wrap {
  width: min(1360px, calc(100% - 48px));
}

body.wyl-study-reader .st-doc {
  max-width: 1280px;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 40px;
}

body.wyl-study-reader .st-doc .st-reader {
  max-width: 990px;
}

body.wyl-study-reader .st-prose {
  max-width: none;
}
/* 覆盖 .wrap 自带的 max-width，否则 width 被压回 1160 */
body.wyl-study-reader .st-wrap {
  max-width: 1360px;
}
/* 移动端：阅读视图回到单列，正文占满 */
@media (max-width: 1180px) {
  body.wyl-study-reader .st-wrap {
    width: calc(100% - 32px);
    max-width: none;
  }

  body.wyl-study-reader .st-doc {
    grid-template-columns: minmax(0, 1fr);
    max-width: none;
    gap: 18px;
  }

  body.wyl-study-reader .st-doc .st-reader {
    max-width: none;
    padding: 22px 16px 30px;
  }
}
/* ==========================================================================
   文件夹树：可折叠（嵌套 ul + 折叠按钮）
   ========================================================================== */

.st-tree-root,
.st-children {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 子层缩进 + 一条竖引导线 */
.st-children {
  margin-left: 9px;
  padding-left: 11px;
  border-left: 1px solid var(--line);
}

/* 收起状态：子层不显示 */
.st-branch:not(.is-open) > .st-children {
  display: none;
}

.st-node {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: 8px;
  transition: background-color .16s ease;
}

.st-node:hover { background: var(--bg-3); }

.st-node > a {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px 7px 2px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--ink-2);
  text-decoration: none;
}

.st-node > a:hover { color: var(--ink); }

.st-node > a[aria-current="true"] {
  background: var(--accent-soft, rgba(44, 95, 141, .1));
  color: var(--accent);
  font-weight: 600;
}

.st-node > a svg { width: 14px; height: 14px; flex: 0 0 auto; opacity: .55; }

/* 折叠按钮：箭头，展开时旋转 90° */
.st-toggle {
  flex: 0 0 auto;
  width: 20px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}

.st-toggle svg {
  width: 13px;
  height: 13px;
  transition: transform .18s var(--ease);
}

.st-toggle:hover { background: var(--line); color: var(--ink); }

.st-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.st-branch.is-open > .st-node .st-toggle svg { transform: rotate(90deg); }

/* 叶子节点占位，保证文字对齐 */
.st-toggle--leaf {
  display: block;
  cursor: default;
}

.st-toggle--leaf:hover { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  .st-toggle svg { transition: none; }
}
/* 树很长时自身滚动，不撑出视口 */
@media (min-width: 1001px) {
  .st-tree {
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 8px;
  }

  .st-tree::-webkit-scrollbar { width: 6px; }
  .st-tree::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 3px;
  }
}
/* ==========================================================================
   正文排版对齐笔记页：17px / 1.88（宽度不变）
   ========================================================================== */

.st-doc .st-prose,
body.wyl-study-reader .st-prose {
  font-size: 17px;
  line-height: 1.88;
}

/* 笔记页的 h2 是 26px（bold.css 放大后的值），h3 19.5px */
.st-doc .st-prose h2,
body.wyl-study-reader .st-prose h2 {
  font-size: 26px;
  line-height: 1.4;
}

.st-doc .st-prose h3,
body.wyl-study-reader .st-prose h3 {
  font-size: 19.5px;
}

.st-doc .st-prose h4,
body.wyl-study-reader .st-prose h4 {
  font-size: 17px;
}

/* 表格与行内代码跟随正文比例（笔记页 .entry-content table 是 15px） */
.st-doc .st-prose table,
body.wyl-study-reader .st-prose table {
  font-size: 15px;
}

.st-doc .st-prose pre,
body.wyl-study-reader .st-prose pre {
  font-size: 13.5px;
}

/* 移动端与笔记页一致：16px / 1.9 */
@media (max-width: 780px) {
  .st-doc .st-prose,
  body.wyl-study-reader .st-prose {
    font-size: 16px;
    line-height: 1.9;
  }

  .st-doc .st-prose h2,
  body.wyl-study-reader .st-prose h2 {
    font-size: 21px;
    line-height: 1.4;
  }
}