/* ========================================================
   Obsidian 数字花园博客工作台样式库 (blog.css)
   沉浸式全屏三栏布局 · Obsidian 风格排版 · 优雅暗色模式适配
   ======================================================== */

/* 全屏工作台容器 */
.blog-body {
  width: 100vw;
  height: 100vh;
  height: 100svh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.blog-app {
  width: 100vw;
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--page);
  color: var(--ink);
  position: relative;
}

/* ---------------- 顶部导航工具栏 ---------------- */
.blog-topbar {
  height: 56px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--chip);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex-shrink: 0;
}

.topbar-left .brand-name {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.topbar-sep {
  color: var(--line);
  font-size: 0.8rem;
}

.topbar-section-title {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.reader-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-left: 0.5rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--line);
}

.reader-breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
  transition: color 150ms ease;
}

.reader-breadcrumbs a:hover {
  color: var(--accent);
}

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

.crumb-current {
  color: var(--ink);
  font-weight: 600;
}

/* 顶栏中心搜索框 */
.topbar-center {
  flex: 1;
  max-width: 520px;
  display: flex;
  justify-content: center;
}

.search-box {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

.search-box input[type="search"] {
  width: 100%;
  height: 36px;
  padding: 0 2.2rem 0 2.2rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--ink) 3%, transparent);
  color: var(--ink);
  font-size: 0.82rem;
  outline: none;
  transition: all 180ms ease;
}

.search-box input[type="search"]::placeholder {
  color: var(--muted);
  opacity: 0.75;
}

.search-box input[type="search"]:focus {
  border-color: var(--accent);
  background: var(--page);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.search-kbd {
  position: absolute;
  right: 0.65rem;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.15rem 0.4rem;
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 0.65rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.2rem;
}

/* 顶栏右侧快捷工具 */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-tool {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.65rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 160ms ease;
}

.btn-tool svg {
  width: 15px;
  height: 15px;
}

.btn-tool:hover {
  color: var(--ink);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-left: 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--line);
}

.topbar-link {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 150ms ease;
}

.topbar-link:hover {
  color: var(--accent);
}

/* ---------------- 三栏布局工作区 ---------------- */
.blog-workspace {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* ---------------- 左侧栏：目录树 ---------------- */
.blog-sidebar {
  width: 290px;
  min-width: 290px;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--chip);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 220ms ease, width 220ms ease, min-width 220ms ease;
  z-index: 40;
  overflow: hidden;
}

.blog-sidebar.collapsed {
  width: 0;
  min-width: 0;
  border-right: none;
  transform: translateX(-100%);
}

.sidebar-header {
  padding: 1.1rem 1.1rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.vault-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.vault-icon {
  font-size: 1.25rem;
}

.vault-title {
  font-size: 0.88rem;
  font-weight: 700;
  display: block;
}

.vault-meta {
  font-size: 0.72rem;
  color: var(--muted);
  display: block;
}

.sidebar-close-btn,
.outline-close-btn {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 160ms ease;
}

.sidebar-close-btn:hover,
.outline-close-btn:hover {
  color: var(--ink);
  border-color: var(--accent);
}

/* 分类胶囊栏 */
.sidebar-filters {
  display: flex;
  gap: 0.4rem;
  padding: 0.75rem 1.1rem;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.sidebar-filters::-webkit-scrollbar {
  display: none;
}

.chip-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 160ms ease;
}

.chip-filter small {
  font-size: 0.65rem;
  opacity: 0.8;
}

.chip-filter:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.chip-filter.active {
  background: var(--accent);
  color: var(--button-ink);
  border-color: var(--accent);
}

/* 树形列表容器 */
.sidebar-tree-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.6rem;
  scrollbar-width: thin;
}

.file-tree {
  font-size: 0.82rem;
}

.tree-list,
.tree-sublist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tree-sublist {
  padding-left: 1.1rem;
  border-left: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  margin-left: 0.85rem;
  margin-top: 0.15rem;
  margin-bottom: 0.25rem;
}

.folder-item {
  margin-bottom: 0.2rem;
}

.folder-item:not(.open) > .tree-sublist {
  display: none;
}

.tree-folder-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 650;
  cursor: pointer;
  user-select: none;
  transition: background 140ms ease;
}

.tree-folder-title:hover {
  background: color-mix(in srgb, var(--ink) 5%, transparent);
}

.folder-arrow {
  font-size: 0.68rem;
  color: var(--muted);
  width: 12px;
  text-align: center;
}

.folder-icon {
  font-size: 0.95rem;
}

.folder-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-file-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.36rem 0.6rem;
  margin: 0.1rem 0;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  transition: all 140ms ease;
  user-select: none;
}

.tree-file-link:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.file-item.active .tree-file-link {
  color: var(--ink);
  font-weight: 650;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-left: 3px solid var(--accent);
  padding-left: calc(0.6rem - 3px);
}

.file-icon {
  font-size: 0.88rem;
  opacity: 0.7;
}

.file-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 搜索结果面板 */
.search-results-panel {
  position: absolute;
  inset: 56px 0 0 0;
  background: var(--page);
  z-index: 60;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.search-results-header {
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.74rem;
  font-weight: 650;
  color: var(--muted);
}

.search-results-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem;
}

.search-item {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 0.65rem;
  background: var(--chip);
  cursor: pointer;
  transition: all 160ms ease;
}

.search-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.search-item-cat {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.search-item-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 650;
}

.search-item-excerpt {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.55;
}

.search-item mark {
  background: color-mix(in srgb, var(--accent) 25%, transparent);
  color: var(--ink);
  font-weight: 650;
  border-radius: 3px;
  padding: 0 2px;
}

/* ---------------- 中间阅读区 ---------------- */
.blog-reader {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  padding: 0;
  background: transparent;
}

.reader-inner {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 3.5rem 3.5rem 6rem;
  transition: max-width 220ms ease;
}

.blog-app.focus-mode .reader-inner {
  max-width: 1040px;
}

/* 移动端操作栏 */
.reader-mobile-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--chip);
  backdrop-filter: blur(16px);
}

.mobile-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.mobile-bar-title {
  flex: 1;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* 文章纸张与头部 */
.article-sheet {
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--chip);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.03);
  padding: clamp(2rem, 5vw, 3.8rem);
}

.sheet-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 2.25rem;
  margin-bottom: 2.5rem;
}

.sheet-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
}

.sheet-category-badge {
  padding: 0.25rem 0.7rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sheet-source-badge {
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.sheet-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-pill {
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  color: var(--muted);
  font-size: 0.7rem;
}

.sheet-title {
  margin: 0 0 1.25rem;
  font-size: clamp(2.1rem, 4.4vw, 3.1rem);
  font-weight: 720;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.sheet-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.meta-sep {
  color: var(--line);
}

.sheet-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.sheet-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 160ms ease;
}

.sheet-action-btn svg {
  width: 14px;
  height: 14px;
}

.sheet-action-btn:hover {
  color: var(--ink);
  border-color: var(--accent);
}

/* ---------------- Markdown 正文排版 (极具质感) ---------------- */
.markdown-body {
  font-size: 1.05rem;
  line-height: 1.88;
  color: var(--ink);
}

.markdown-body p {
  margin: 1.35rem 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.35;
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  position: relative;
}

.markdown-body h2 {
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
}

.markdown-body h3 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.markdown-body h4 {
  font-size: 1.15rem;
}

.heading-anchor {
  position: absolute;
  left: -1.25rem;
  color: var(--accent);
  opacity: 0;
  text-decoration: none;
  font-weight: 400;
  transition: opacity 150ms ease;
}

.article-heading:hover .heading-anchor {
  opacity: 0.8;
}

.markdown-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 150ms ease;
}

.markdown-body a:hover {
  opacity: 0.8;
}

.markdown-body strong {
  font-weight: 700;
  color: var(--ink);
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.75rem;
  margin: 1.25rem 0;
}

.markdown-body li {
  margin: 0.45rem 0;
}

.markdown-body hr {
  margin: 3rem 0;
  border: none;
  border-top: 1px dashed var(--line);
}

/* 引用块 Blockquote */
.markdown-body blockquote {
  margin: 1.75rem 0;
  padding: 0.85rem 1.35rem;
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--muted);
}

.markdown-body blockquote p {
  margin: 0.5rem 0;
}

/* Obsidian Callouts 提示框 */
.obsidian-callout {
  margin: 1.75rem 0;
  border-radius: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  background: var(--chip);
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.02);
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.15rem;
  font-size: 0.86rem;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}

.callout-body {
  padding: 0.85rem 1.15rem;
  font-size: 0.95rem;
  line-height: 1.75;
}

.callout-body p:first-child {
  margin-top: 0;
}

.callout-body p:last-child {
  margin-bottom: 0;
}

.callout-tip {
  border-left-color: #22c55e;
}
.callout-tip .callout-title {
  background: color-mix(in srgb, #22c55e 12%, transparent);
}

.callout-warning,
.callout-caution {
  border-left-color: #f59e0b;
}
.callout-warning .callout-title,
.callout-caution .callout-title {
  background: color-mix(in srgb, #f59e0b 12%, transparent);
}

.callout-danger {
  border-left-color: #ef4444;
}
.callout-danger .callout-title {
  background: color-mix(in srgb, #ef4444 12%, transparent);
}

.callout-quote {
  border-left-color: #8b5cf6;
}
.callout-quote .callout-title {
  background: color-mix(in srgb, #8b5cf6 12%, transparent);
}

/* Obsidian Wikilink 双链卡片 */
.markdown-body a.obsidian-wikilink {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.55rem;
  margin: 0 0.15rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  transition: all 140ms ease;
}

.markdown-body a.obsidian-wikilink:hover {
  background: var(--accent);
  color: var(--button-ink);
}

/* Obsidian 高亮标记 */
.obsidian-mark {
  background: color-mix(in srgb, #eab308 30%, transparent);
  color: var(--ink);
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
}

/* 代码块 Code Block (带复制与语言标题) */
.code-block-wrapper {
  margin: 1.85rem 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #19241b;
  color: #edf2eb;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.code-lang {
  font-family: monospace;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #a4bfa8;
}

.btn-copy-code {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: transparent;
  color: #a4bfa8;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  transition: all 140ms ease;
}

.btn-copy-code:hover {
  color: #ffffff;
  border-color: #a4bfa8;
}

.code-block-wrapper pre {
  margin: 0;
  padding: 1.25rem 1.4rem;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.7;
}

.markdown-body :not(pre) > code {
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85em;
}

/* 表格 Table */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1.85rem 0;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table-wrap th,
.table-wrap td {
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.table-wrap th {
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  font-weight: 700;
}

.table-wrap tr:last-child td {
  border-bottom: none;
}

/* 底部文章切换导航 */
.sheet-footer-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 4rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--line);
}

.nav-card {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--chip);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: all 180ms ease;
}

.nav-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.next-card {
  text-align: right;
  grid-column: 2;
}

.nav-dir {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
}

.nav-title {
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 加载骨架与错误状态 */
.sheet-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 0;
  color: var(--muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1.25rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.sheet-error {
  padding: 3rem;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--muted);
}

/* ---------------- 右侧栏：大纲 TOC ---------------- */
.blog-outline {
  width: 280px;
  min-width: 280px;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--chip);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 1.1rem;
  overflow-y: auto;
  scrollbar-width: thin;
  transition: transform 220ms ease, width 220ms ease, min-width 220ms ease;
  z-index: 40;
}

.blog-outline.collapsed {
  width: 0;
  min-width: 0;
  padding: 0;
  border-left: none;
  overflow: hidden;
}

.outline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.outline-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.outline-toc-wrap {
  flex: 1;
  margin-bottom: 1.75rem;
}

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

.toc-item {
  margin: 0.35rem 0;
}

.toc-level-h2 {
  padding-left: 0;
}

.toc-level-h3 {
  padding-left: 1rem;
  font-size: 0.78rem;
}

.toc-level-h4 {
  padding-left: 1.8rem;
  font-size: 0.75rem;
}

.toc-link {
  display: block;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  line-height: 1.45;
  transition: all 140ms ease;
}

.toc-link:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.toc-link.active {
  color: var(--accent);
  font-weight: 650;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.toc-empty {
  color: var(--muted);
  font-size: 0.8rem;
  font-style: italic;
  padding: 0.5rem;
}

/* 笔记信息与相关笔记小卡片 */
.outline-note-card,
.outline-related {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--ink) 3%, transparent);
  margin-top: 1.25rem;
}

.card-subtitle {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-dl {
  display: grid;
  grid-template-columns: 70px 1fr;
  row-gap: 0.45rem;
  column-gap: 0.5rem;
  font-size: 0.75rem;
  margin: 0;
}

.card-dl dt {
  color: var(--muted);
}

.card-dl dd {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.related-item {
  margin: 0.35rem 0;
}

.related-item a {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 150ms ease;
}

.related-item a:hover {
  color: var(--accent);
}

.related-empty {
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}

/* ---------------- 提示 Toast ---------------- */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 0.65rem 1.35rem;
  background: #17271e;
  color: #f4f7ef;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: all 200ms ease;
  z-index: 100;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------------- 响应式适配 (移动端 & 平板) ---------------- */
@media (max-width: 1200px) {
  .blog-outline {
    display: none;
  }
}

@media (max-width: 900px) {
  .blog-sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    width: 300px;
    z-index: 100;
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
  }

  .blog-sidebar:not(.collapsed) {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 56px 0 0 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
  }

  .sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  .reader-inner {
    padding: 1.5rem 1.25rem 4rem;
  }

  .reader-mobile-bar {
    display: flex;
  }

  .article-sheet {
    padding: 1.75rem 1.35rem;
    border-radius: 18px;
  }

  .sheet-title {
    font-size: 1.85rem;
  }

  .sheet-actions {
    width: 100%;
    margin-top: 1rem;
    justify-content: flex-start;
  }

  .topbar-section-title,
  .reader-breadcrumbs {
    display: none;
  }

  .topbar-links {
    display: none;
  }
}

@media (max-width: 600px) {
  .sheet-footer-nav {
    grid-template-columns: 1fr;
  }
  .next-card {
    grid-column: 1;
    text-align: left;
  }
}
