/* obsidian.css —— 1:1 Obsidian 默认界面质感层（在 app.css 之后加载）。
   采用 Obsidian 默认深色主题的量级：primary #1e1e1e / secondary #262626 / accent #7f6df2。
   目标是桌面版信息架构在网页中的高保真还原：纯图标 ribbon、无品牌标题栏、居中可读行宽、Live Preview。 */

:root {
  --background-primary: #1e1e1e;
  --background-primary-alt: #1a1a1a;
  --background-secondary: #262626;
  --background-secondary-alt: #202020;
  --background-modifier-hover: rgba(255, 255, 255, 0.055);
  --background-modifier-active-hover: rgba(255, 255, 255, 0.08);
  --background-modifier-border: #333333;
  --background-modifier-border-hover: #3f3f3f;
  --background-modifier-form-field: #1e1e1e;
  --text-normal: #dcddde;
  --text-muted: #b3b3b3;
  --text-faint: #666666;
  --text-on-accent: #ffffff;
  --text-accent: #a99bf5;
  --text-selection: rgba(127, 109, 242, 0.32);
  --interactive-normal: #2a2a2a;
  --interactive-hover: #363636;
  --interactive-accent: #7f6df2;
  --interactive-accent-hover: #8d7cf5;
  --interactive-success: #3fb950;
  --text-highlight-bg: rgba(255, 208, 0, 0.28);
  --tag-background: rgba(127, 109, 242, 0.16);
  --tag-color: #a99bf5;
  --font-interface: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, "Noto Sans", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-text: var(--font-interface);
  --font-monospace: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, "Liberation Mono", monospace;
  --font-text-size: 16px;
  --content-width: 760px;
  --line-height-normal: 1.6;
  --line-height-tight: 1.28;
  --status-bar-height: 22px;
  --tab-height: 38px;
  --ribbon-width: 44px;
  --sidebar-width: 255px;
  --right-sidebar-width: 300px;
  --radius-s: 4px;
  --radius-m: 6px;
  --radius-l: 8px;

  --bg: var(--background-primary);
  --bg-elevated: var(--background-secondary);
  --bg-panel: var(--background-secondary);
  --bg-panel-2: var(--background-secondary-alt);
  --bg-editor: var(--background-primary);
  --bg-hover: var(--background-modifier-hover);
  --bg-active: var(--background-modifier-active-hover);
  --border: var(--background-modifier-border);
  --border-strong: var(--background-modifier-border-hover);
  --text: var(--text-normal);
  --text-strong: #f0f0f0;
  --text-muted: var(--text-muted);
  --text-faint: var(--text-faint);
  --accent: var(--interactive-accent);
  --accent-strong: var(--interactive-accent-hover);
  --accent-soft: rgba(127, 109, 242, 0.15);
  --accent-contrast: var(--text-on-accent);
  --accent-deep: #6b5cdb;
  --danger: #e05b65;
  --danger-soft: rgba(224, 91, 101, 0.13);
  --success: #3fb950;
  --warning: #d8a657;
  --code-bg: rgba(255, 255, 255, 0.055);
  --input-bg: var(--background-modifier-form-field);
  --editor-font-size: var(--font-text-size);
  --radius: var(--radius-m);
  --radius-sm: var(--radius-s);
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.46);
  --shadow-soft: 0 5px 20px rgba(0, 0, 0, 0.28);
  --ribbon-w: var(--ribbon-width);
  --left-w: var(--sidebar-width);
  --right-w: var(--right-sidebar-width);
  --status-h: var(--status-bar-height);
  --content-max: var(--content-width);
}

[data-theme="light"] {
  --background-primary: #ffffff;
  --background-primary-alt: #f6f6f6;
  --background-secondary: #f2f3f5;
  --background-secondary-alt: #e9eaec;
  --background-modifier-hover: rgba(0, 0, 0, 0.05);
  --background-modifier-active-hover: rgba(0, 0, 0, 0.075);
  --background-modifier-border: #dadada;
  --background-modifier-border-hover: #c0c0c0;
  --background-modifier-form-field: #ffffff;
  --text-normal: #2e3338;
  --text-muted: #5c6370;
  --text-faint: #999999;
  --text-accent: #6f5ce0;
  --text-selection: rgba(127, 109, 242, 0.22);
  --interactive-normal: #e9e9e9;
  --interactive-hover: #dedede;
  --interactive-accent: #705dcf;
  --interactive-accent-hover: #806fee;
  --tag-background: rgba(112, 93, 207, 0.12);
  --tag-color: #6f5ce0;
  --text-highlight-bg: rgba(255, 208, 0, 0.36);
  --bg: var(--background-primary);
  --bg-elevated: var(--background-primary);
  --bg-panel: var(--background-secondary);
  --bg-panel-2: var(--background-secondary-alt);
  --bg-editor: var(--background-primary);
  --bg-hover: var(--background-modifier-hover);
  --bg-active: var(--background-modifier-active-hover);
  --border: var(--background-modifier-border);
  --border-strong: var(--background-modifier-border-hover);
  --text: var(--text-normal);
  --text-strong: #171a1d;
  --text-muted: var(--text-muted);
  --text-faint: var(--text-faint);
  --accent: var(--interactive-accent);
  --accent-strong: var(--interactive-accent-hover);
  --accent-soft: rgba(112, 93, 207, 0.12);
  --accent-contrast: #ffffff;
  --code-bg: rgba(0, 0, 0, 0.04);
  --input-bg: var(--background-modifier-form-field);
  --shadow: 0 16px 48px rgba(30, 22, 54, 0.18);
  --shadow-soft: 0 5px 20px rgba(30, 22, 54, 0.11);
}

[data-accent="violet"], :root { --accent: #7f6df2; --accent-strong: #9285f5; --accent-soft: rgba(127, 109, 242, 0.15); --accent-contrast: #ffffff; --text-accent: #a99bf5; --interactive-accent: #7f6df2; --interactive-accent-hover: #9285f5; }
[data-accent="blue"] { --accent: #5b8def; --accent-strong: #72a2ff; --accent-soft: rgba(91, 141, 239, 0.15); --accent-contrast: #ffffff; --text-accent: #8db4ff; --interactive-accent: #5b8def; --interactive-accent-hover: #72a2ff; }
[data-accent="teal"] { --accent: #3fb6a8; --accent-strong: #5cc9bb; --accent-soft: rgba(63, 182, 168, 0.14); --accent-contrast: #ffffff; --text-accent: #71d3c6; --interactive-accent: #3fb6a8; --interactive-accent-hover: #5cc9bb; }
[data-accent="rose"] { --accent: #e06c91; --accent-strong: #f084a6; --accent-soft: rgba(224, 108, 145, 0.14); --accent-contrast: #ffffff; --text-accent: #f29bbe; --interactive-accent: #e06c91; --interactive-accent-hover: #f084a6; }
[data-accent="amber"] { --accent: #d4a24c; --accent-strong: #e5b563; --accent-soft: rgba(212, 162, 76, 0.14); --accent-contrast: #201607; --text-accent: #e5bd75; --interactive-accent: #d4a24c; --interactive-accent-hover: #e5b563; }
[data-theme="light"][data-accent="violet"] { --accent: #705dcf; --accent-strong: #5b48b7; --accent-soft: rgba(112, 93, 207, 0.11); --text-accent: #6f5ce0; --interactive-accent: #705dcf; }
[data-theme="light"][data-accent="blue"] { --accent: #3b70c4; --accent-strong: #2b5ca9; --accent-soft: rgba(59, 112, 196, 0.1); --text-accent: #376fca; }
[data-theme="light"][data-accent="teal"] { --accent: #21877c; --accent-strong: #196d64; --accent-soft: rgba(33, 135, 124, 0.1); --text-accent: #21877c; }
[data-theme="light"][data-accent="rose"] { --accent: #b34f72; --accent-strong: #963c5c; --accent-soft: rgba(179, 79, 114, 0.1); --text-accent: #b34f72; }
[data-theme="light"][data-accent="amber"] { --accent: #956a24; --accent-strong: #7c561a; --accent-soft: rgba(149, 106, 36, 0.1); --text-accent: #956a24; }

html, body { background: var(--background-primary); }
body { color: var(--text-normal); font-family: var(--font-interface); font-size: 13px; }
::selection { background: var(--text-selection); color: var(--text-normal); }

/* 隐藏旧自定义标题栏与品牌条 —— Obsidian 内容区由 ribbon / tabs 直接开始 */
.titlebar { display: none !important; }
.app-shell { background: var(--background-primary); }
.app-body { min-height: 0; }

/* 窗口级：左侧纯图标 ribbon */
.ribbon {
  width: var(--ribbon-width); flex-basis: var(--ribbon-width); background: var(--background-primary);
  border-right: 0; padding: 7px 5px 6px; gap: 1px;
}
.ribbon-btn {
  width: 33px; height: 33px; min-height: 33px; margin: 0 auto; border-radius: var(--radius-s);
  padding: 0; color: #8b8b8b; display: inline-flex; align-items: center; justify-content: center;
}
.ribbon-btn span { display: none !important; }
.ribbon-btn svg { stroke-width: 1.9; }
.ribbon-btn:hover { color: var(--text-normal); background: var(--background-modifier-hover); }
.ribbon-btn.active { color: var(--text-normal); background: var(--background-modifier-active-hover); }
.ribbon-btn.is-hidden { display: none !important; }
.ribbon-group { gap: 1px; }
.ribbon-bottom { gap: 1px; padding-bottom: 1px; }
.ribbon-main { align-items: center; }
#vault-menu svg { width: 19px; height: 19px; }

/* 左侧栏 / 右侧栏：Obsidian 密度 */
.left-sidebar, .right-sidebar { background: var(--background-secondary); border-color: var(--background-modifier-border); }
.left-sidebar { width: var(--sidebar-width); flex-basis: var(--sidebar-width); border-right: 1px solid var(--background-modifier-border); }
.right-sidebar { width: var(--right-sidebar-width); flex-basis: var(--right-sidebar-width); border-left: 1px solid var(--background-modifier-border); }
.sidebar-tabs-row { height: 38px; flex-basis: 38px; padding: 0 7px 0 9px; border-bottom: 1px solid var(--background-modifier-border); }
.sidebar-tabs { gap: 1px; }
.sidebar-tab { width: 30px; height: 28px; border: none; border-radius: var(--radius-s); color: #9a9a9a; }
.sidebar-tab:hover { color: var(--text-normal); background: var(--background-modifier-hover); }
.sidebar-tab.active { color: var(--text-normal); background: var(--background-modifier-active-hover); border: none; }

.side-panel { min-height: 0; }
.nav-title { color: var(--text-faint); font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; margin-right: auto; padding-left: 3px; }
.side-panel [hidden], .side-item-list[hidden] { display: none !important; }
[hidden] { display: none !important; }
.wikilink-popover { z-index: 3000; }
.note-view[data-mode="read"] .inline-title-wrap:not(.read-only) { display: none; }
.note-view[data-mode="source"] .inline-title-wrap.read-only { display: none; }
.note-view[data-mode="live"] .inline-title-wrap.read-only { display: none; }
.panel-heading { display: none; }
.panel-tools { padding: 5px 8px 4px 10px; gap: 1px; }
.tool-spacer { flex: 1; }
.file-tree-scroll { padding: 3px 6px 12px; }
.file-tree { min-height: 100%; }
.tree-row { height: 24px; margin: 0; border: none; border-radius: var(--radius-s); padding: 0 3px 0 calc(4px + var(--tree-depth) * 14px); color: var(--text-muted); gap: 0; }
.tree-row:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.tree-row.active { background: var(--background-modifier-active-hover); color: var(--text-normal); }
.tree-row.active::before { display: none; }
.tree-chevron { width: 15px; flex-basis: 15px; color: var(--text-faint); }
.tree-chevron svg { width: 12px !important; height: 12px !important; }
.tree-icon { display: none !important; }
.tree-label { font-size: 13px; line-height: 1; color: inherit; }
.tree-folder > .tree-row .tree-label { color: var(--text-normal); font-weight: 450; }
.tree-row.active .tree-label { color: var(--text-normal); }
.tree-mini-action { display: none; }
.sidebar-footer { display: none !important; }
.tree-empty { color: var(--text-faint); gap: 7px; margin: 34px 16px; }
.tree-empty p { color: var(--text-muted); font-size: 12.5px; }
.tree-empty span { font-size: 11px; }

/* 文件树顶部：将旧的 heading/count 压成一个 Obsidian 风格 nav header */
.file-panel { padding-top: 0; }
.file-panel .panel-tools { height: 32px; padding: 0 8px 4px 11px; }
.file-panel::before { content: ""; display: block; height: 0; }
.nav-file-count { display: none; }

/* 搜索面板：Obsidian 的简单查询条和结果 */
.search-panel { background: var(--background-secondary); }
.search-box { margin: 8px 9px 6px; height: 30px; background: var(--background-modifier-form-field); border: 1px solid var(--background-modifier-border); border-radius: var(--radius-s); padding: 0 8px; }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.search-box input { font-size: 12.5px; }
.search-summary { padding: 4px 12px 6px; font-size: 11px; color: var(--text-faint); }
.search-result { padding: 6px 8px; border-radius: var(--radius-s); gap: 1px; }
.search-result:hover { background: var(--background-modifier-hover); border-color: transparent; }
.search-result-title { font-size: 13px; font-weight: 550; }
.search-result-path { font-size: 10.5px; color: var(--text-faint); }
.search-result-snippet { font-size: 11.5px; color: var(--text-muted); }
.tag-cloud { display: none; }
.search-empty { color: var(--text-faint); }

/* 新侧栏页：书签 / 标签 */
.side-panel-header { height: 32px; display: flex; align-items: center; padding: 0 12px; color: var(--text-faint); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.side-item-list { padding: 2px 7px; display: flex; flex-direction: column; gap: 1px; }
.side-item { width: 100%; border: 1px solid transparent; border-radius: var(--radius-s); background: transparent; color: var(--text-muted); padding: 5px 8px; text-align: left; font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.side-item:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.side-item .count { margin-left: auto; color: var(--text-faint); font-size: 10.5px; }
.side-panel .side-empty { color: var(--text-faint); font-size: 11.5px; line-height: 1.6; padding: 20px 18px; text-align: center; }
.side-item .hash { color: var(--text-accent); font-family: var(--font-monospace); font-size: 10px; }

/* 主工作区与 tab 条 */
.workspace { background: var(--background-primary); }
.tab-bar { height: 38px; flex-basis: 38px; background: var(--background-primary); border-bottom: 0; padding: 5px 6px 0 7px; align-items: flex-end; }
.tabs { align-items: flex-end; gap: 3px; }
.tab { min-width: 104px; max-width: 220px; height: 32px; background: transparent; border-right: 0; border-radius: var(--radius-s) var(--radius-s) 0 0; color: var(--text-muted); }
.tab:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.tab.active { background: var(--background-secondary); color: var(--text-normal); box-shadow: none; }
.tab-title { padding: 0 5px 0 10px; gap: 0; }
.tab-title svg { display: none !important; }
.tab-title > span:not(.tab-dot) { font-size: 13px; font-weight: 450; }
.tab-dot { background: var(--text-muted); }
.tab-close { width: 20px; height: 20px; opacity: 0; margin-right: 4px; }
.tab:hover .tab-close, .tab.active .tab-close { opacity: .75; }
.tab-close:hover { background: var(--interactive-hover); color: var(--text-normal); }
.tab-actions { padding: 0 2px 3px 6px; border-left: 0; gap: 0; }
.tab-action-btn { width: 28px; height: 28px; border: 0; background: transparent; color: var(--text-muted); border-radius: var(--radius-s); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.tab-action-btn:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.tab-action-btn.active { background: var(--background-modifier-active-hover); color: var(--text-normal); }
.tab-action-btn[hidden] { display: none !important; }
.workspace-content { background: var(--background-primary); }
.editor-host { background: var(--background-primary); }
.graph-host { background: var(--background-primary); }

/* 右侧栏更贴近 Obsidian 的 side dock */
.right-header { display: none; }
.right-tabs { height: 38px; flex: 0 0 38px; padding: 0 7px; gap: 1px; border-bottom: 1px solid var(--background-modifier-border); }
.right-tabs button { flex: 0 1 auto; height: 28px; padding: 0 9px; border-radius: var(--radius-s); border: none; color: var(--text-muted); font-size: 12px; gap: 5px; justify-content: flex-start; }
.right-tabs button:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.right-tabs button.active { background: var(--background-modifier-active-hover); color: var(--text-normal); border: none; }
.right-tabs::after { content: ""; flex: 1; }
.right-sidebar .side-collapse-button { margin-left: auto; }
.right-content { padding: 0; }
.right-section-title { padding: 12px 14px 4px; font-size: 10.5px; letter-spacing: .025em; color: var(--text-faint); text-transform: none; font-weight: 650; }
.right-details summary { height: 34px; padding: 0 14px; font-size: 12px; color: var(--text-normal); font-weight: 600; }
.right-details summary em { color: var(--text-faint); font-weight: 500; background: none; }
.right-details { border-bottom: 1px solid var(--background-modifier-border); }
.link-row { padding: 5px 7px; border-radius: var(--radius-s); }
.link-row-title { font-size: 12.5px; font-weight: 500; }
.link-row-path { font-size: 10.5px; color: var(--text-faint); }
.link-row:hover { background: var(--background-modifier-hover); border-color: transparent; }


/* 反向链接：来源分组、上下文与筛选 */
.backlinks-filter-wrap { padding: 6px 9px 4px; }
.backlinks-filter {
  width: 100%; height: 27px; padding: 0 8px; border-radius: 5px;
  border: 1px solid var(--background-modifier-border);
  background: var(--background-modifier-form-field); color: var(--text-normal);
  font-family: var(--font-ui); font-size: 11.5px;
}
.backlinks-filter:focus { outline: none; border-color: var(--text-accent); box-shadow: 0 0 0 1px var(--text-accent); }
.backlinks-filter::placeholder { color: var(--text-faint); }
.backlink-group { padding: 0 6px 5px; }
.backlink-group[hidden] { display: none !important; }
.backlink-group-head { display: flex; align-items: center; gap: 6px; padding: 5px 4px 2px; color: var(--text-muted); }
.backlink-group-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-normal); font-size: 11.5px; font-weight: 600; }
.backlink-group-head em { color: var(--text-faint); font-style: normal; font-size: 10px; font-weight: 500; }
.backlink-context-row {
  display: block; width: 100%; margin: 1px 0; padding: 5px 7px;
  border: 0; border-radius: 4px; background: transparent; color: var(--text-muted);
  text-align: left; font-family: var(--font-text); font-size: 11px; line-height: 1.45; cursor: pointer;
}
.backlink-context-row[hidden] { display: none !important; }
.backlink-context-row:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.backlink-context-text {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere;
}
.backlink-context-row mark { background: rgba(127, 109, 242, 0.25); color: var(--text-normal); border-radius: 2px; padding: 0 1px; }
.backlink-context-meta { display: block; margin-top: 2px; color: var(--text-faint); font-size: 9.5px; }
.backlinks-filter-empty { padding: 10px 12px; color: var(--text-faint); font-size: 11px; }
.backlinks-filter-empty[hidden] { display: none !important; }


/* 未链接提及的一键建链 */
.mention-row-wrap { display: flex; align-items: flex-start; gap: 4px; padding: 2px 0; }
.mention-row-wrap .mention-row { flex: 1; min-width: 0; width: auto; }
.mention-link-btn {
  flex: 0 0 auto; margin-top: 5px; padding: 3px 7px;
  border: 1px solid var(--background-modifier-border); border-radius: 4px;
  background: var(--interactive-normal); color: var(--text-muted);
  font-family: var(--font-ui); font-size: 10px; cursor: pointer; white-space: nowrap;
}
.mention-link-btn:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.mention-link-btn:disabled { opacity: .5; cursor: default; }


.right-empty-block { border: 0; padding: 16px 12px; text-align: left; margin: 4px 10px; }
.right-empty-block h3 { color: var(--text-muted); font-size: 12.5px; }
.right-empty-block p { color: var(--text-faint); font-size: 11px; }
.outline-list { padding: 3px 6px 9px; }
.outline-row { color: var(--text-muted); font-size: 12px; padding: 3px 6px; }
.outline-row:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.outline-row.level-1 { color: var(--text-normal); font-weight: 500; }
.info-table { padding: 4px 12px; }
.info-table > div { font-size: 11px; border-bottom: 0; padding: 3px 0; grid-template-columns: 86px 1fr; }
.tag-row { padding: 2px 12px 10px; }
.tag-pill { border: 0; background: var(--tag-background); color: var(--tag-color); border-radius: 3px; font-size: 11px; padding: 1px 7px; }
.right-action-btn { background: var(--interactive-normal); border: 1px solid var(--background-modifier-border); font-size: 12px; height: 28px; }
.right-footnote { color: var(--text-faint); font-size: 10px; border-color: var(--background-modifier-border); }

/* 状态栏：尽量少、安静、默认 Obsidian 质感 */
.statusbar { height: var(--status-bar-height); flex-basis: var(--status-bar-height); padding: 0 10px; background: var(--background-primary); border-top: 1px solid var(--background-modifier-border); color: var(--text-faint); font-size: 10.5px; gap: 8px; }
.status-left, .status-center, .status-right { gap: 10px; }
#status-session, #status-edition, #status-mode { display: none !important; }
#status-save { color: var(--text-faint); }
#status-save .mini-dot { width: 5px; height: 5px; }
#status-links { color: var(--text-faint); }
.status-item { gap: 4px; }
.status-divider { height: 9px; background: var(--background-modifier-border); }

/* TAB 模式按钮图标 */
#view-mode-toggle svg, #view-more svg, #new-tab svg, #toggle-right svg { width: 16px; height: 16px; }

/* 新编辑器骨架：Obsidian inline title + properties + Live Preview */
.note-view { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--background-primary); }


/* 当前笔记内查找 */
.note-view { position: relative; }
.find-bar {
  position: absolute; top: 10px; right: 28px; z-index: 35;
  width: min(460px, calc(100% - 56px));
  padding: 8px; border: 1px solid var(--background-modifier-border); border-radius: 8px;
  background: var(--background-secondary);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.3);
  color: var(--text-normal);
}
.find-bar[hidden] { display: none !important; }
.find-row { display: flex; align-items: center; gap: 6px; }
.find-row + .find-row { margin-top: 6px; }
.find-row[hidden] { display: none !important; }
.find-input, .find-replace-input {
  flex: 1; min-width: 0; height: 28px; padding: 0 8px; border-radius: 5px;
  border: 1px solid var(--background-modifier-border);
  background: var(--background-modifier-form-field); color: var(--text-normal);
  font-family: var(--font-text); font-size: 12px;
}
.find-input:focus, .find-replace-input:focus {
  outline: none; border-color: var(--text-accent);
  box-shadow: 0 0 0 1px var(--text-accent);
}
.find-count {
  min-width: 46px; text-align: right; color: var(--text-muted);
  font-variant-numeric: tabular-nums; font-size: 11px; white-space: nowrap;
}
.find-btn {
  height: 26px; min-width: 26px; padding: 0 7px; border: 0; border-radius: 5px;
  background: transparent; color: var(--text-muted);
  font-family: var(--font-ui); font-size: 11px; cursor: pointer; white-space: nowrap;
}
.find-btn:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.find-close { margin-left: 2px; font-size: 16px; line-height: 1; }
::highlight(obsidian-web-find-all) { background-color: rgba(255, 205, 60, 0.32); color: inherit; }
::highlight(obsidian-web-find-current) { background-color: rgba(255, 145, 40, 0.58); color: inherit; }

.note-view .editor-scroller { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.note-view .view-content { width: 100%; max-width: var(--content-width); margin: 0 auto; padding: 38px 34px 130px; font-size: var(--font-text-size); }
.note-view.wide-editor .view-content { max-width: 940px; }
.inline-title-wrap { display: block; margin: 0 0 6px; }
.inline-title {
  display: block; width: 100%; border: 0; outline: none; padding: 0; margin: 0;
  background: transparent; color: var(--text-normal);
  font-family: var(--font-text); font-size: 2em; line-height: 1.25; font-weight: 650;
  letter-spacing: -0.015em; caret-color: var(--text-accent);
}
.inline-title:hover { color: var(--text-normal); }
.inline-title:focus { color: var(--text-normal); }
.inline-title::placeholder { color: var(--text-faint); font-weight: 500; }
.inline-title-display { margin: 0 0 8px; color: var(--text-normal); font-family: var(--font-text); font-size: 2em; line-height: 1.25; font-weight: 650; letter-spacing: -0.015em; overflow-wrap: anywhere; }

.metadata-container { margin: 5px 0 25px; font-family: var(--font-interface); font-size: 12.5px; }
.metadata-properties { border-top: 1px solid var(--background-modifier-border); }
.metadata-property { display: grid; grid-template-columns: 120px minmax(0, 1fr); min-height: 30px; align-items: center; gap: 7px; border-bottom: 1px solid var(--background-modifier-border); }
.metadata-property-key { color: var(--text-faint); font-size: 11px; padding: 5px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metadata-property-value { color: var(--text-normal); display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 4px; align-items: center; }
.metadata-value-chip { display: inline-flex; align-items: center; border-radius: var(--radius-s); background: var(--background-secondary); color: var(--text-muted); padding: 1px 7px; font-size: 11.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.metadata-value-chip.tag-chip { background: var(--tag-background); color: var(--tag-color); }
.metadata-empty-hint { color: var(--text-faint); }
.metadata-property:hover { background: var(--background-modifier-hover); }
.metadata-property:hover .metadata-property-key { color: var(--text-muted); }

.markdown-preview, .live-preview-container { color: var(--text-normal); background: transparent; font-family: var(--font-text); font-size: var(--font-text-size); line-height: var(--line-height-normal); padding: 0; max-width: none; }
.markdown-preview { padding-bottom: 30px; }
.markdown-preview h1, .markdown-preview h2, .markdown-preview h3, .markdown-preview h4, .markdown-preview h5, .markdown-preview h6 {
  font-family: var(--font-text); color: var(--text-normal); font-weight: 650; line-height: var(--line-height-tight); letter-spacing: -0.01em;
  margin: 1.25em 0 .55em; padding: 0; border: none;
}
.markdown-preview > *:first-child, .markdown-preview h1:first-child, .markdown-preview h2:first-child, .markdown-preview h3:first-child { margin-top: 0; }
.markdown-preview h1 { font-size: 1.8em; border: none; }
.markdown-preview h2 { font-size: 1.5em; border: none; padding: 0; }
.markdown-preview h3 { font-size: 1.25em; }
.markdown-preview h4 { font-size: 1.1em; }
.markdown-preview h5 { font-size: 1em; }
.markdown-preview h6 { font-size: .94em; color: var(--text-muted); }
.markdown-preview p { margin: 0 0 .75em; line-height: var(--line-height-normal); }
.markdown-preview strong { color: var(--text-normal); font-weight: 700; }
.markdown-preview em { color: var(--text-normal); }
.markdown-preview a { color: var(--text-accent); text-decoration: none; }
.markdown-preview a:hover { text-decoration: underline; text-underline-offset: 2px; }
.markdown-preview .internal-link { color: var(--text-accent); border: none; }
.markdown-preview .internal-link.is-unresolved { color: var(--text-muted); opacity: .72; border: none; }
.markdown-preview .tag { background: var(--tag-background); color: var(--tag-color); border: none; border-radius: 3px; padding: 0 5px; font-family: var(--font-interface); font-size: .8em; line-height: 1.7; text-decoration: none; }
.markdown-preview ul, .markdown-preview ol { margin: .35em 0 .7em; padding-left: 1.65em; }
.markdown-preview li { margin: .1em 0; padding-left: .1em; }
.markdown-preview li::marker { color: var(--text-muted); }
.markdown-preview .task-list { padding-left: .4em; }
.markdown-preview .task-list-item { gap: 7px; }
.markdown-preview .task-checkbox { width: 15px; height: 15px; margin-top: .28em; border: 1.5px solid var(--text-faint); border-radius: 3px; }
.markdown-preview .task-checkbox:checked { background: var(--interactive-accent); border-color: var(--interactive-accent); }
.markdown-preview .task-checkbox:checked::after { border-color: var(--text-on-accent); left: 4px; top: 1px; }
.markdown-preview blockquote { margin: .8em 0; padding: .1em 1em; border-left: 2px solid var(--interactive-accent); background: transparent; border-radius: 0; color: var(--text-muted); }
.markdown-preview blockquote p { margin: .4em 0; }
.markdown-preview .callout { border: 1px solid var(--background-modifier-border); border-left: 3px solid var(--interactive-accent); border-radius: var(--radius-s); background: rgba(127,109,242,.06); padding: .7em 1em; margin: .8em 0; font-family: var(--font-interface); font-size: .95em; }
.markdown-preview .callout-title { font-weight: 650; color: var(--text-normal); margin-bottom: .3em; }
.markdown-preview .callout p { margin: .25em 0; }
.markdown-preview .callout-tip { border-left-color: var(--success); background: rgba(63,185,80,.06); }
.markdown-preview .callout-warning { border-left-color: var(--warning); background: rgba(216,166,87,.06); }
.markdown-preview .callout-danger { border-left-color: var(--danger); background: var(--danger-soft); }
.markdown-preview code.inline-code { font-family: var(--font-monospace); font-size: .85em; background: var(--code-bg); border: 1px solid var(--background-modifier-border); border-radius: 3px; padding: .1em .3em; color: var(--text-normal); }
.markdown-preview .md-code { margin: .8em 0; border: 1px solid var(--background-modifier-border); border-radius: var(--radius-m); background: var(--background-primary-alt); }
.markdown-preview .md-code-head { background: transparent; border-bottom: 1px solid var(--background-modifier-border); color: var(--text-faint); }
.markdown-preview .md-copy { color: var(--text-muted); }
.markdown-preview pre { background: transparent; padding: 12px 14px; }
.markdown-preview .md-code code { color: var(--text-normal); font-size: 12.5px; }
.markdown-preview table { border-collapse: collapse; font-size: .92em; }
.markdown-preview th, .markdown-preview td { border: 1px solid var(--background-modifier-border); padding: 5px 9px; }
.markdown-preview th { background: var(--background-secondary); font-weight: 600; }
.markdown-preview .md-table-wrap { border-radius: var(--radius-s); }
.markdown-preview hr { border: 0; border-top: 1px solid var(--background-modifier-border); margin: 1.7em 0; }
.markdown-preview img.md-image { border-radius: var(--radius-s); border: none; box-shadow: none; margin: 1em 0; }
.markdown-preview .heading-anchor { color: var(--text-faint); }
.markdown-preview .md-properties { display: none; }

/* Live Preview 块：显示渲染态，点击后当前块揭示 Markdown 源 */
.live-preview-container { padding-bottom: 28px; }
.live-block { position: relative; padding: 0; margin: 0; border-radius: var(--radius-s); }
.live-block > * { max-width: 100%; }
.live-block:hover { background: rgba(255,255,255,.018); }
.live-block.is-editing { background: rgba(255,255,255,.028); box-shadow: 0 0 0 1px var(--background-modifier-border); }
.live-block .block-editor {
  display: block; width: 100%; min-height: 1.6em; padding: 0; margin: 0; border: 0; outline: 0;
  background: transparent; color: var(--text-normal); resize: none; overflow: hidden;
  font-family: var(--font-text); font-size: var(--font-text-size); line-height: var(--line-height-normal);
  caret-color: var(--text-accent);
}
.live-block[data-kind="h1"] .block-editor { font-size: 1.8em; font-weight: 650; line-height: 1.3; }
.live-block[data-kind="h2"] .block-editor { font-size: 1.5em; font-weight: 650; line-height: 1.3; }
.live-block[data-kind="h3"] .block-editor { font-size: 1.25em; font-weight: 650; line-height: 1.35; }
.live-block[data-kind="h4"] .block-editor { font-size: 1.1em; font-weight: 650; }
.live-block[data-kind="code"] .block-editor { font-family: var(--font-monospace); font-size: 13px; background: var(--background-primary-alt); border: 1px solid var(--background-modifier-border); border-radius: var(--radius-s); padding: 10px; }
.live-block[data-kind="quote"] .block-editor, .live-block[data-kind="callout"] .block-editor { border-left: 2px solid var(--interactive-accent); padding-left: 12px; color: var(--text-muted); }
.live-block[data-kind="list"] .block-editor { font-family: var(--font-text); }
.live-block[data-kind="table"] .block-editor { font-family: var(--font-monospace); font-size: 13px; }
.live-block.is-editing::before { content: ""; position: absolute; left: -10px; top: 3px; bottom: 3px; width: 2px; background: var(--interactive-accent); border-radius: 2px; opacity: .8; }
.block-editor::placeholder { color: var(--text-faint); }
.live-empty-area { min-height: 28px; color: var(--text-faint); font-size: 13px; cursor: text; padding: 2px 0; }
.live-empty-area:hover { color: var(--text-muted); }
.live-end-area { height: 34px; cursor: text; }
.live-block .heading-anchor, .live-block .md-copy { opacity: 0; }
.live-block:hover .heading-anchor, .live-block:hover .md-copy { opacity: 1; }

/* 源码模式（Obsidian 文本型编辑器，居中行宽） */
.source-editor-wrap { min-height: 55vh; }
textarea.markdown-source {
  display: block; width: 100%; min-height: 55vh; height: calc(100vh - 180px);
  border: 0; outline: 0; resize: none; overflow: auto; padding: 0; margin: 0;
  background: transparent; color: var(--text-normal); font-family: var(--font-text);
  font-size: var(--font-text-size); line-height: var(--line-height-normal); tab-size: 4; caret-color: var(--text-accent);
}
.note-view[data-mode="source"] .source-editor-wrap { display: block; }
.note-view[data-mode="source"] .live-preview-container, .note-view[data-mode="source"] .reading-container { display: none; }
.note-view[data-mode="live"] .source-editor-wrap, .note-view[data-mode="live"] .reading-container { display: none; }
.note-view[data-mode="read"] .source-editor-wrap, .note-view[data-mode="read"] .live-preview-container { display: none; }
.reading-container { padding-bottom: 40px; }
.note-view[data-mode="read"] .inline-title { display: none; }
.note-view[data-mode="read"] .inline-title-display { display: block; }
.note-view[data-mode="read"] .metadata-container { margin-bottom: 20px; }
.inline-title-wrap.read-only { display: none; }
.note-view[data-mode="read"] .inline-title-wrap.read-only { display: block; }

.conflict-banner { padding: 6px 14px; background: var(--danger-soft); border-bottom: 1px solid var(--background-modifier-border); font-size: 11.5px; gap: 10px; }
.conflict-copy strong { color: var(--danger); font-weight: 600; }
.conflict-copy span { color: var(--text-muted); }
.conflict-actions .ow-btn.small { height: 25px; min-height: 25px; font-size: 11px; }
.note-empty { color: var(--text-faint); }
.note-empty h2 { font-size: 17px; color: var(--text-muted); font-weight: 600; }
.empty-mark { border: 1px solid var(--background-modifier-border); background: var(--background-secondary); transform: none; border-radius: var(--radius-m); }
.empty-mark::after { inset: 14px; border-color: var(--text-faint); border-radius: 2px; }

/* Wikilink 补全：Obsidian suggestion 风格 */
.wikilink-popover { left: 0; right: auto; bottom: auto; min-width: 280px; max-width: 420px; background: var(--background-secondary); border: 1px solid var(--background-modifier-border); border-radius: var(--radius-m); box-shadow: var(--shadow-soft); padding: 5px; }
.suggest-head { font-size: 10px; letter-spacing: .02em; text-transform: none; color: var(--text-faint); }
.suggest-item { border: 0; padding: 5px 7px; border-radius: var(--radius-s); }
.suggest-item:hover, .suggest-item.active { background: var(--interactive-accent); }
.suggest-item:hover .suggest-title, .suggest-item:hover .suggest-path, .suggest-item.active .suggest-title, .suggest-item.active .suggest-path { color: var(--text-on-accent); }
.suggest-title { font-size: 12.5px; font-weight: 500; color: var(--text-normal); }
.suggest-path { font-size: 10.5px; color: var(--text-faint); }

/* Page preview (hover Wikilink) */
.page-preview-card { position: fixed; z-index: 5000; width: min(460px, calc(100vw - 20px)); max-height: min(420px, 56vh); display: flex; flex-direction: column; overflow: hidden; background: var(--background-secondary); border: 1px solid var(--background-modifier-border); border-radius: var(--radius-m); box-shadow: 0 14px 44px rgba(0, 0, 0, .45); color: var(--text-normal); font-family: var(--font-interface); }
.page-preview-card[hidden] { display: none; }
.page-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 13px 8px; border-bottom: 1px solid var(--background-modifier-border); background: var(--background-secondary-alt); flex: 0 0 auto; }
.page-preview-titles { min-width: 0; }
.page-preview-title { font-size: 13px; font-weight: 600; color: var(--text-normal); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-preview-path { margin-top: 1px; font-size: 10px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-preview-hint { flex: 0 0 auto; font-size: 10px; color: var(--text-faint); }
.page-preview-body { padding: 10px 16px 16px; overflow: auto; min-height: 28px; font-family: var(--font-text); font-size: 13.5px; line-height: 1.6; color: var(--text-normal); }
.page-preview-body > :first-child { margin-top: 2px; }
.page-preview-body h1 { font-size: 24px; }
.page-preview-body h2 { font-size: 20px; }
.page-preview-body h3 { font-size: 17px; }
.page-preview-body h4, .page-preview-body h5, .page-preview-body h6 { font-size: 14px; }
.page-preview-body p { margin: .45em 0; }
.page-preview-more { margin-top: 8px; border: 1px solid var(--background-modifier-border); border-radius: var(--radius-s); background: var(--interactive-normal); color: var(--text-muted); font-family: var(--font-interface); font-size: 11px; padding: 4px 8px; }
.page-preview-more:hover { background: var(--interactive-hover); color: var(--text-normal); }
.slash-command-item .suggest-title { color: var(--text-normal); }

/* r5: search syntax hint + core plugin toggles */
.search-syntax-hint { padding: 0 18px 8px; font-size: 10px; line-height: 1.55; color: var(--text-faint); }
.core-plugin-state.is-toggle { cursor: pointer; border: 1px solid var(--background-modifier-border); background: var(--interactive-normal); color: var(--text-muted); border-radius: var(--radius-s); padding: 2px 7px; font-family: var(--font-interface); font-size: 10.5px; }
.core-plugin-state.is-toggle:hover { background: var(--interactive-hover); color: var(--text-normal); }
.core-plugin-state.is-toggle.is-off { color: var(--text-faint); background: transparent; opacity: .8; }

@media (max-width: 700px) { .page-preview-card { display: none !important; } }


/* 命令面板：Obsidian prompt */
.palette-backdrop { background: rgba(0,0,0,.52); padding-top: 9vh; }
.command-palette { width: min(620px, 94vw); max-height: 62vh; background: var(--background-secondary); border: 1px solid var(--background-modifier-border); border-radius: var(--radius-l); box-shadow: var(--shadow); }
.palette-input-row { padding: 11px 12px; border-bottom: 1px solid var(--background-modifier-border); gap: 8px; }
.palette-leading { color: var(--text-muted); }
.palette-input { font-size: 16px; height: 24px; color: var(--text-normal); font-family: var(--font-interface); }
.palette-esc { display: none; }
.palette-meta { display: none; }
.palette-results { padding: 4px; }
.palette-row { min-height: 32px; border-radius: var(--radius-s); padding: 3px 8px; gap: 7px; border: 0; }
.palette-row:hover, .palette-row.active { background: var(--interactive-accent); color: var(--text-on-accent); }
.palette-icon { display: none; }
.palette-row-main { gap: 0; }
.palette-row-title { font-size: 13px; color: var(--text-normal); }
.palette-row.active .palette-row-title { color: var(--text-on-accent); }
.palette-row-sub { font-size: 11px; color: var(--text-faint); }
.palette-row.active .palette-row-sub { color: rgba(255,255,255,.75); }
.palette-row kbd { background: transparent; border: none; box-shadow: none; color: var(--text-faint); font-size: 10px; padding: 0; }
.palette-row.active kbd { color: rgba(255,255,255,.75); }
.palette-time { display: none; }
.palette-footer { display: none; }
.palette-empty { color: var(--text-faint); }

/* 菜单和模态 */
.context-menu { background: var(--background-secondary); border: 1px solid var(--background-modifier-border); border-radius: var(--radius-m); padding: 4px; min-width: 200px; box-shadow: var(--shadow-soft); }
.menu-item { height: 27px; padding: 0 8px; border: 0; border-radius: var(--radius-s); color: var(--text-normal); font-size: 12.5px; }
.menu-item:hover { background: var(--background-modifier-hover); border: 0; }
.menu-item.danger { color: var(--text-normal); }
.menu-item.danger:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.menu-item.danger svg { color: var(--text-muted); }
.menu-shortcut { color: var(--text-faint); }
.menu-separator { background: var(--background-modifier-border); margin: 4px 6px; }
.menu-item svg { color: var(--text-muted); }
.ow-btn { background: var(--interactive-normal); border: 1px solid var(--background-modifier-border); color: var(--text-normal); border-radius: var(--radius-s); font-size: 12px; min-height: 28px; padding: 3px 12px; }
.ow-btn:hover { background: var(--interactive-hover); border-color: var(--background-modifier-border); }
.ow-btn.primary { background: var(--interactive-accent); border-color: var(--interactive-accent); color: var(--text-on-accent); }
.ow-btn.primary:hover { background: var(--interactive-accent-hover); border-color: var(--interactive-accent-hover); }
.ow-btn.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.text-input { background: var(--background-modifier-form-field); border: 1px solid var(--background-modifier-border); border-radius: var(--radius-s); height: 32px; }
.text-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.modal { background: var(--background-secondary); border: 1px solid var(--background-modifier-border); border-radius: var(--radius-l); }
.modal-content { padding: 18px 20px 14px; }
.modal-head h2 { font-size: 16px; font-weight: 600; color: var(--text-normal); }
.modal-desc { color: var(--text-muted); font-size: 12px; }
.modal-actions { gap: 6px; margin-top: 15px; }
.toast { background: var(--background-secondary); border: 1px solid var(--background-modifier-border); border-left: 2px solid var(--accent); color: var(--text-normal); border-radius: var(--radius-m); font-size: 12px; }
kbd { background: var(--background-secondary-alt); border: 1px solid var(--background-modifier-border); border-radius: 3px; box-shadow: none; color: var(--text-muted); font-size: 10px; padding: 2px 4px; }

/* 图标按钮 */
.icon-btn { border: 0; background: transparent; color: var(--text-muted); width: 28px; height: 28px; }
.icon-btn:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.icon-btn.active { background: var(--background-modifier-active-hover); color: var(--text-normal); }
.icon-btn.tiny { width: 26px; height: 26px; }

/* 设置弹窗：Obsidian 左分类右内容 */
.settings-modal-content { max-height: 80vh; }
.settings-shell { display: flex; width: min(980px, 90vw); min-height: 530px; max-height: 78vh; background: var(--background-secondary); border: 1px solid var(--background-modifier-border); border-radius: var(--radius-l); box-shadow: var(--shadow); overflow: hidden; }
.modal-backdrop .settings-shell { animation: rise .14s ease-out; }
.settings-nav { width: 215px; flex: 0 0 215px; border-right: 1px solid var(--background-modifier-border); padding: 14px 8px; background: var(--background-secondary-alt); }
.settings-nav-title { font-size: 14px; font-weight: 600; color: var(--text-normal); padding: 4px 10px 14px; }
.settings-nav-item { width: 100%; height: 31px; border: 0; background: transparent; border-radius: var(--radius-s); color: var(--text-muted); text-align: left; padding: 0 10px; font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.settings-nav-item:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.settings-nav-item.active { background: var(--background-modifier-active-hover); color: var(--text-normal); }
.settings-detail { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.settings-detail-head { height: 46px; flex: 0 0 46px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--background-modifier-border); color: var(--text-normal); font-size: 14px; font-weight: 600; }
.settings-detail-body { padding: 8px 22px 24px; overflow: auto; }
.settings-group-title { color: var(--text-faint); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; padding: 16px 0 6px; border-bottom: 1px solid var(--background-modifier-border); }
.settings-row { min-height: 39px; border-bottom: 1px solid var(--background-modifier-border); color: var(--text-normal); font-size: 12.5px; }
.settings-row .desc { display: block; color: var(--text-faint); font-size: 11px; margin-top: 2px; }
.settings-row select, .settings-row input[type="text"], .settings-row input[type="number"] { height: 27px; border: 1px solid var(--background-modifier-border); background: var(--background-modifier-form-field); color: var(--text-normal); border-radius: var(--radius-s); font-size: 12px; }
.settings-row select:hover { border-color: var(--background-modifier-border-hover); }
.accent-swatch { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--background-secondary); border: 2px solid transparent; }
.accent-swatch.selected { border-color: var(--text-normal); }
.range-wrap input { accent-color: var(--interactive-accent); }
.settings-action-row { gap: 6px; padding: 10px 0; }
.settings-note { color: var(--text-muted); font-size: 11.5px; line-height: 1.6; }
.settings-note.subtle { color: var(--text-faint); font-size: 11px; }
.help-body section { padding-bottom: 15px; margin-bottom: 14px; }
.help-hero { background: transparent !important; border: none !important; padding: 0 !important; }
.help-body h3 { color: var(--text-normal); font-size: 14px; }
.help-body h4 { color: var(--text-muted); font-size: 12px; }
.help-body p { color: var(--text-muted); font-size: 12px; }

/* 设置开关 */
.switch { position: relative; width: 28px; height: 16px; display: inline-block; flex: 0 0 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--background-modifier-border); border-radius: 999px; transition: background .15s ease; }
.switch .track::after { content: ""; position: absolute; width: 12px; height: 12px; left: 2px; top: 2px; background: var(--text-muted); border-radius: 50%; transition: transform .15s ease, background .15s ease; }
.switch input:checked + .track { background: var(--interactive-accent); }
.switch input:checked + .track::after { transform: translateX(12px); background: #fff; }
.settings-row input[type="checkbox"]:not(.switch input) { accent-color: var(--interactive-accent); }

/* 搜索与帮助按钮 */
.search-box-icon { color: var(--text-faint); }
.search-panel-header { display: flex; align-items: center; height: 32px; padding: 0 11px; color: var(--text-muted); font-size: 11px; font-weight: 600; gap: 5px; }
.search-panel-header .icon { color: var(--text-faint); }

/* 图谱视图：Obsidian 的暗底画布 */
.graph-view { background: var(--background-primary); }
.graph-header { padding: 10px 14px 8px; border-bottom: 1px solid var(--background-modifier-border); align-items: center; }
.graph-title-block h2 { font-size: 13px; font-weight: 600; color: var(--text-normal); letter-spacing: 0; }
.graph-subtitle { display: none; }
.graph-stats { font-size: 11px; color: var(--text-faint); }
.graph-toolbar { margin: 0; padding: 7px 12px; background: var(--background-primary); border-bottom: 1px solid var(--background-modifier-border); gap: 8px; }
.graph-search { height: 28px; flex-basis: 210px; background: var(--background-modifier-form-field); border: 1px solid var(--background-modifier-border); border-radius: var(--radius-s); }
.graph-search input { font-size: 12px; }
.graph-scope { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--background-modifier-border); border-radius: var(--radius-s); background: var(--background-modifier-form-field); }
.graph-scope-btn { border: 0; background: transparent; color: var(--text-muted); font-size: 11px; line-height: 1.4; padding: 2px 8px; border-radius: 4px; cursor: pointer; font-family: inherit; }
.graph-scope-btn:hover { color: var(--text-normal); }
.graph-scope-btn.is-active { background: var(--background-primary); color: var(--text-normal); box-shadow: 0 0 0 1px var(--background-modifier-border); }
.graph-scope-btn:disabled { opacity: .4; cursor: not-allowed; }
.graph-depth-wrap, .graph-direction-wrap { gap: 5px; }
.graph-depth-wrap[hidden], .graph-direction-wrap[hidden] { display: none !important; }
.graph-depth, .graph-direction { height: 24px; min-width: 62px; border: 1px solid var(--background-modifier-border); border-radius: var(--radius-s); background: var(--background-modifier-form-field); color: var(--text-normal); font-size: 11px; padding: 0 4px; font-family: inherit; cursor: pointer; }
.graph-depth:disabled, .graph-direction:disabled { opacity: .5; cursor: default; }
.graph-view.is-local .graph-title-block h2 { color: var(--text-normal); }
.check-label { color: var(--text-muted); font-size: 11px; }
.graph-canvas { background: var(--background-primary); }
.graph-canvas-wrap::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgba(255,255,255,.055) .8px, transparent .8px); background-size: 18px 18px; opacity: .8; }
.graph-tooltip { background: var(--background-secondary); border: 1px solid var(--background-modifier-border); color: var(--text-normal); font-size: 11px; }
.graph-hint { display: none; }

/* 模态/设置 backdrop 与其他 */
.modal-backdrop:has(.settings-shell) { padding: 5vh 16px; align-items: flex-start; }
.modal .modal-content:empty { display: none; }
.image-lightbox { background: rgba(0,0,0,.8); }
.settings-section { border-bottom: 1px solid var(--background-modifier-border); }
.settings-section h3 { color: var(--text-faint); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; margin: 16px 0 6px; font-weight: 600; }
.settings-body { gap: 0; }
.settings-section { padding-bottom: 8px; }

/* 新版导航辅助控件 */
#toggle-left { display: none !important; }
#open-help { display: none !important; }
.quick-open { display: none !important; }
.vault-switcher { display: none !important; }

/* 标签页右侧按钮区域的「当前 leaf」模式图标 */
.tab-actions .action-separator { width: 1px; height: 16px; background: var(--background-modifier-border); margin: 0 3px; }

/* 菜单中模式项 */
.menu-item .mode-check { width: 15px; flex: 0 0 15px; color: var(--text-accent); }

@media (max-width: 1180px) {
  .right-sidebar { width: min(330px, 88vw); }
  .note-view .view-content { padding-left: 26px; padding-right: 26px; }
}
@media (max-width: 900px) {
  :root { --ribbon-width: 42px; --sidebar-width: 250px; }
  .titlebar { display: none !important; }
  .ribbon { width: var(--ribbon-width); flex-basis: var(--ribbon-width); }
  .left-sidebar { width: var(--sidebar-width); flex-basis: var(--sidebar-width); }
  .nav-header { padding-top: 2px; }
  .note-view .view-content { padding: 24px 20px 100px; }
  .inline-title { font-size: 1.65em; }
  .settings-shell { width: 100%; height: 86vh; max-height: 86vh; flex-direction: column; }
  .settings-nav { width: 100%; flex: 0 0 auto; display: flex; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--background-modifier-border); }
  .settings-nav-title { display: none; }
  .settings-nav-item { width: auto; flex: 0 0 auto; padding: 0 12px; }
  .settings-detail-head { height: 40px; flex-basis: 40px; }
  .settings-detail-body { padding: 4px 16px 20px; }
  .tab-actions .tab-action-btn { width: 26px; }
}

/* Note transclusion embeds */
.md-embed { margin: .9em 0; border: 1px solid var(--background-modifier-border); border-radius: var(--radius-m); background: var(--background-secondary); overflow: hidden; }
.md-embed-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 5px 10px; border-bottom: 1px solid var(--background-modifier-border); background: var(--background-secondary-alt); }
.md-embed-title { font-family: var(--font-interface); font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-embed-title:hover { color: var(--text-accent); text-decoration: none; }
.md-embed-path { font-family: var(--font-interface); font-size: 9.5px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-embed-body { padding: 4px 14px 10px; background: var(--background-primary); font-size: .95em; }
.md-embed-body > :first-child { margin-top: .6em; }
.md-embed-body .md-embed { margin: .7em 0; }
.md-embed-body .md-embed .md-embed-body { background: var(--background-secondary); }
.md-embed-body h1 { font-size: 1.7em; }
.md-embed-body h2 { font-size: 1.4em; }
.md-embed-body h3 { font-size: 1.2em; }
.md-embed-body .md-embed-head { padding: 4px 9px; }
.md-embed input.task-checkbox { pointer-events: none; opacity: .65; }
.md-embed.is-missing, .md-embed.is-cycle { background: transparent; border-style: dashed; }
.md-embed.is-missing .md-embed-head, .md-embed.is-cycle .md-embed-head { background: transparent; }
.md-embed-empty { color: var(--text-faint); font-size: 12px; font-family: var(--font-interface); }
.page-preview-body .md-embed { margin: .65em 0; }


/* Split editor groups */
.workspace-panes { --split-width: 50%; flex: 1; min-width: 0; min-height: 0; display: flex; }
.editor-group { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
.main-group { flex: 1; }
.split-group { flex: 0 0 var(--split-width, 50%); max-width: var(--split-width, 50%); min-width: 260px; border-left: 1px solid var(--background-modifier-border); background: var(--background-primary); }
.split-group[hidden] { display: none !important; }
.split-resizer { flex: 0 0 5px; width: 5px; margin: 0 -2px; position: relative; z-index: 30; cursor: col-resize; background: transparent; outline: none; }
.split-resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 2px; width: 1px; background: transparent; transition: background .1s ease, width .1s ease; }
.split-resizer:hover::after, .split-resizer.dragging::after, .split-resizer:focus-visible::after { background: var(--interactive-accent); width: 2px; opacity: .8; }
.split-resizer[hidden] { display: none !important; }
body.resizing-split { cursor: col-resize; user-select: none; }
body.resizing-split * { cursor: col-resize !important; }

/* Mermaid flowcharts */
.md-mermaid { margin: 1.1em 0; padding: 14px; border: 1px solid var(--background-modifier-border); border-radius: 8px; background: var(--background-secondary); overflow-x: auto; }
.md-mermaid svg { display: block; width: 100%; max-width: 100%; height: auto; margin: 0 auto; font-family: var(--font-interface); }
.md-mermaid-node .md-mermaid-shape { fill: var(--background-primary); stroke: var(--background-modifier-border); stroke-width: 1.3; }
.md-mermaid-shape-line { stroke: var(--background-modifier-border); stroke-width: 1; }
.md-mermaid-label { fill: var(--text-normal); font-size: 13px; }
.md-mermaid-edge { fill: none; stroke: var(--text-normal); opacity: .58; stroke-width: 1.4; }
.md-mermaid-edge.is-dashed { stroke-dasharray: 4 4; }
.md-mermaid-edge.is-thick { stroke-width: 2.2; }
.md-mermaid-arrow { fill: var(--text-normal); opacity: .72; }
.md-mermaid-state .md-mermaid-node .md-mermaid-state-terminal { fill: var(--text-normal); stroke: none; opacity: .82; }
.md-mermaid-state .md-mermaid-node .md-mermaid-state-terminal-node { pointer-events: none; }


/* Mermaid class diagrams */
.md-mermaid-class-box { fill: var(--background-primary); stroke: var(--background-modifier-border); stroke-width: 1.2; }
.md-mermaid-class-title { font-size: 12.5px; font-weight: 650; }
.md-mermaid-class-member { fill: var(--text-muted); font-size: 10.5px; font-family: var(--font-monospace, monospace); }
.md-mermaid-class-member.is-method { fill: var(--text-normal); opacity: .84; }
.md-mermaid-class-stereotype { fill: var(--text-faint); font-size: 9.5px; font-style: italic; letter-spacing: .02em; }
.md-mermaid-class-divider { stroke: var(--background-modifier-border); stroke-width: 1; }
.md-mermaid-class-edge { opacity: .6; }
.md-mermaid-class-edge.is-dashed { stroke-dasharray: 4 4; }
.md-mermaid-class-edge-label { font-size: 10.5px; }
.md-mermaid-class-marker-arrow { fill: var(--text-normal); opacity: .72; }
.md-mermaid-class-marker-triangle { fill: var(--background-secondary); stroke: var(--text-normal); stroke-width: 1; }
.md-mermaid-class-marker-diamond { fill: var(--text-normal); opacity: .68; }
.md-mermaid-class-marker-diamond-open { fill: var(--background-secondary); stroke: var(--text-normal); stroke-width: 1; }

.md-mermaid-edge-label { fill: var(--text-normal); opacity: .78; font-size: 11px; paint-order: stroke; stroke: var(--background-secondary); stroke-width: 4px; }
.md-mermaid-error { margin: 1.1em 0; border: 1px dashed var(--background-modifier-border); border-radius: 8px; background: var(--background-secondary); padding: 10px 14px; color: var(--text-muted); font-size: .9em; }
.md-mermaid-note { margin-bottom: 8px; }
.md-mermaid-error pre { margin: 0; overflow-x: auto; }
.md-mermaid-error code { font-family: var(--font-monospace, monospace); font-size: 12px; color: var(--text-normal); }

/* Mermaid sequence diagrams */
.md-mermaid-sequence .md-mermaid-lifeline { stroke: var(--background-modifier-border); stroke-width: 1; stroke-dasharray: 4 5; }
.md-mermaid-sequence-message { stroke: var(--text-normal); opacity: .65; stroke-width: 1.4; }
.md-mermaid-sequence-message.is-dashed { stroke-dasharray: 5 4; }
.md-mermaid-sequence-label { fill: var(--text-normal); opacity: .82; font-size: 11.5px; paint-order: stroke; stroke: var(--background-secondary); stroke-width: 4px; }
.md-mermaid-sequence-note .md-mermaid-note-shape { fill: var(--background-primary); stroke: var(--background-modifier-border); }
.md-mermaid-sequence-note .md-mermaid-note-fold { fill: none; stroke: var(--background-modifier-border); }
.md-mermaid-sequence-note .md-mermaid-note-text { fill: var(--text-normal); opacity: .8; font-size: 11px; }
.md-mermaid-sequence-cross { stroke: var(--text-normal); opacity: .7; stroke-width: 1.2; }

/* Mermaid pie charts */
.md-mermaid-pie-title { fill: var(--text-normal); font-size: 14px; font-weight: 600; }
.md-mermaid-pie-slice { stroke: var(--background-secondary); stroke-width: 1.5; }
.md-mermaid-pie-percent { fill: #fff; font-size: 10.5px; font-weight: 600; paint-order: stroke; stroke: rgba(0, 0, 0, .22); stroke-width: 2px; }
.md-mermaid-pie-legend-label { fill: var(--text-normal); font-size: 12px; }
.md-mermaid-pie-legend-value { fill: var(--text-normal); opacity: .65; font-size: 11px; }

/* Collapsible callouts */
.callout-title { display: flex; align-items: center; gap: 6px; }
.callout-title-inner { flex: 1; min-width: 0; }
.callout-fold { flex: 0 0 auto; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.callout-fold::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-1px, -1px); transition: transform .12s ease; }
.callout-fold:hover { background: var(--background-modifier-hover); color: var(--text-normal); }
.callout.is-collapsed .callout-fold::before { transform: rotate(-45deg) translate(-2px, 0); }
.callout.is-collapsed .callout-content { display: none; }
.callout.is-collapsed .callout-title { margin-bottom: 0; }
.tab-pin { display: inline-flex; align-items: center; flex: 0 0 auto; color: var(--text-accent); opacity: .9; }
.tab.is-pinned .tab-title { padding-left: 3px; }

/* Footnotes */
.footnote-ref { font-size: .76em; line-height: 1; vertical-align: super; }
.footnote-link { color: var(--text-accent); text-decoration: none; padding: 0 .1em; }
.footnote-link:hover { text-decoration: underline; }
.md-inline-footnote { position: relative; cursor: help; }
.md-inline-footnote-tip { display: none; position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); z-index: 60; width: max-content; max-width: min(300px, 70vw); padding: 6px 8px; border: 1px solid var(--background-modifier-border); border-radius: var(--radius-s); background: var(--background-secondary); color: var(--text-normal); font-family: var(--font-interface); font-size: 11.5px; font-style: normal; font-weight: 400; line-height: 1.5; letter-spacing: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; box-shadow: 0 6px 18px rgba(0, 0, 0, .28); pointer-events: none; }
.md-inline-footnote:hover .md-inline-footnote-tip, .md-inline-footnote:focus-within .md-inline-footnote-tip, .md-inline-footnote.is-open .md-inline-footnote-tip { display: block; }
.md-inline-footnote-link { display: inline-block; min-width: 1em; text-align: center; }
.md-footnote-missing { color: var(--text-faint); font-style: italic; }
.md-footnotes { margin-top: 2.4em; border-top: 1px solid var(--background-modifier-border); padding-top: 1em; color: var(--text-muted); font-size: .92em; }
.md-footnotes h4 { margin: 0 0 .55em; font-size: .82em; color: var(--text-muted); font-weight: 600; letter-spacing: .04em; }
.md-footnote-list { display: flex; flex-direction: column; gap: .2em; }
.md-footnote-item { display: flex; gap: .55em; padding: .28em .4em; border-radius: 4px; scroll-margin-block: 100px; }
.md-footnote-label { color: var(--text-accent); flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.md-footnote-text { color: var(--text-normal); }
.md-footnote-def { margin: .5em 0; padding: .45em .7em; border-left: 2px solid var(--background-modifier-border); background: var(--background-secondary); color: var(--text-muted); font-size: .92em; border-radius: 0 4px 4px 0; }
.md-footnote-def .md-footnote-label { margin-right: .4em; }
.md-footnote-item.is-footnote-target, .md-footnote-def.is-footnote-target { animation: footnote-target-flash 1.5s ease-out; }
@keyframes footnote-target-flash {
  0%, 25% { background-color: var(--text-selection, rgba(127, 109, 242, .24)); }
  100% { background-color: transparent; }
}

/* Block references */
.block-anchor { display: inline; scroll-margin-block: 96px; }
.is-block-target { border-radius: 4px; animation: block-target-flash 1.6s ease-out; }
@keyframes block-target-flash {
  0%, 28% { background-color: var(--text-selection, rgba(127, 109, 242, .26)); }
  100% { background-color: transparent; }
}
.split-group .workspace-content { min-width: 0; }

/* 文件恢复：版本列表 */
.recovery-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; max-height: 56vh; overflow: auto; }
.recovery-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 9px; border: 1px solid var(--background-modifier-border);
  border-radius: 6px; background: var(--background-secondary);
}
.recovery-meta { flex: 0 0 126px; display: flex; flex-direction: column; gap: 2px; color: var(--text-faint); font-size: 10px; }
.recovery-meta strong { color: var(--text-muted); font-size: 10.5px; font-weight: 600; }
.recovery-snippet {
  flex: 1; min-width: 0; color: var(--text-muted); font-size: 11px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.recovery-restore { flex: 0 0 auto; }


/* MathML formulas */
.md-math { display: inline-block; max-width: 100%; vertical-align: middle; }
.md-math math { font-size: 1.06em; }
.md-math-display { display: block; width: 100%; overflow-x: auto; }
.md-math-block { display: flex; justify-content: center; padding: 10px 0; overflow-x: auto; }
.md-math-block .md-math { max-width: 100%; }
.md-math-error { color: var(--text-error, #e06c75); border-bottom: 1px dashed var(--text-error, #e06c75); font-family: var(--font-monospace, monospace); white-space: pre-wrap; }
.split-group .tab-bar { border-bottom: 1px solid var(--background-modifier-border); }
.split-group .tabs { min-width: 0; }
.split-group .tab { max-width: 100%; }
.split-group .tab-actions { border-left: 1px solid var(--background-modifier-border); }
.editor-group:not(.is-focused) .tab.active { color: var(--text-muted); }
@media (max-width: 900px) {
  .split-group, .split-resizer { display: none !important; }
}
@media (max-width: 640px) {
  .tab-bar { height: 40px; flex-basis: 40px; padding-left: 4px; }
  .tab { min-width: 112px; }
  .tab-actions { gap: 0; }
  .view-content { max-width: 100%; }
  .statusbar { font-size: 10px; }
  #status-cursor { display: none; }
  .graph-header { padding: 8px 10px; }
  .graph-title-block h2 { font-size: 12px; }
}
