.note-tab.active {
  color: #312e81;
  background: linear-gradient(90deg, #e5eaff 0%, #f1f3ff 100%);
  box-shadow: inset 3px 0 0 #4f46e5, 0 2px 5px rgba(79,70,229,.08);
}

.note-tab.active .note-tab-title { font-weight: 700; }

html, body { height: 100%; overflow: hidden; }
* { scrollbar-width: thin; scrollbar-color: #b8c0cf transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: #b8c0cf; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #8792a5; background-clip: padding-box; }
*::-webkit-scrollbar-corner { background: transparent; }
.app-main { height: 100dvh; padding: 16px; }
.workspace { height: calc(100dvh - 32px); min-height: 0; }
.sidebar, .editor { min-height: 0; height: 100%; }
.tabs { min-height: 0; scrollbar-width: thin; }
.editor { overflow: hidden; }
.markdown-toolbar { width: min(900px, calc(100% - 48px)); max-width: none; }
.editor-content { flex: 1; min-height: 0; padding: 0 0 15px; }
.editor-content > .editable-preview,
.editor-content > .lines,
.editor-content > .empty-action { width: min(900px, calc(100% - 48px)); min-height: 0; height: 100%; margin: 0 auto; }
.editor-content { overflow: hidden; }
.editor-content > .editable-preview,
.editor-content > .lines { overflow-y: auto; scrollbar-gutter: stable; }
.editor-content > .editable-preview::-webkit-scrollbar { width: 10px; }
.editor-content > .editable-preview::-webkit-scrollbar-track { background: transparent; }
.editor-content > .editable-preview::-webkit-scrollbar-thumb { border: 3px solid #fff; border-radius: 999px; background: #cbd2df; }
.editor-content > .editable-preview::-webkit-scrollbar-thumb:hover { background: #98a2b3; }

.dialog { padding: 24px; background: rgba(15, 23, 42, .38); backdrop-filter: blur(6px); }
.dialog-card { padding: 26px; border: 1px solid rgba(255,255,255,.72); border-radius: 16px; box-shadow: 0 28px 80px rgba(15,23,42,.28); }
.dialog-card h2 { color: #182230; letter-spacing: -.3px; }.dialog-card p { color: #667085; line-height: 1.65; }
.archive-dialog-card { width: min(466px,calc(100% - 32px)); padding: 0; overflow: hidden; background: linear-gradient(145deg,#fff 0%,#fbfcff 100%); }
.archive-dialog-heading { display: flex; gap: 15px; padding: 26px 28px 20px; border-bottom: 1px solid #eaecf3; }
.archive-dialog-icon { display: grid; flex: 0 0 auto; width: 42px; height: 42px; place-items: center; border: 1px solid #dfe3ff; border-radius: 13px; color: #4f46e5; background: linear-gradient(145deg,#f0f1ff,#e6e8ff); box-shadow: inset 0 1px rgba(255,255,255,.72); font-size: 24px; font-weight: 700; }
.archive-dialog-eyebrow { margin: 1px 0 2px !important; color: #6366f1 !important; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.archive-dialog-heading h2 { margin: 0; font-size: 20px; line-height: 1.35; }
.archive-dialog-description { margin: 6px 0 0; font-size: 13px; }
.archive-dialog-fields { display: grid; gap: 14px; padding: 22px 28px 18px; }
.archive-field { display: grid; gap: 7px; color: #344054; font-size: 13px; font-weight: 650; }
.archive-field > span { display: flex; align-items: center; justify-content: space-between; }
.archive-field em { color: #98a2b3; font-size: 11px; font-style: normal; font-weight: 500; }
.archive-field input, .archive-field select { width: 100%; height: 42px; padding: 0 12px; border-color: #dfe3ec; border-radius: 9px; color: #344054; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.archive-field input::placeholder { color: #a5adbc; }
.archive-field input:focus, .archive-field select:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,.13); }
.archive-field-divider { display: flex; align-items: center; gap: 10px; color: #98a2b3; font-size: 11px; font-weight: 600; }
.archive-field-divider::before, .archive-field-divider::after { height: 1px; flex: 1; background: #eaecf3; content: ''; }
.archive-dialog-tip { display: flex; align-items: flex-start; gap: 8px; margin: 0 28px; padding: 10px 12px; border: 1px solid #e6e8ff; border-radius: 9px; color: #667085; background: #f7f7ff; font-size: 12px; line-height: 1.55; }
.archive-dialog-tip span { color: #6366f1; line-height: 1.45; }
.archive-dialog-actions { align-items: center; margin-top: 20px; padding: 18px 28px 22px; border-top: 1px solid #f0f1f5; }
.archive-dialog-actions button:not(.primary) { padding: 8px 13px; border: 1px solid #dfe3ec; border-radius: 8px; color: #475467; background: #fff; cursor: pointer; font-weight: 600; }
.archive-dialog-actions button:not(.primary):hover { background: #f8fafc; }
.archive-dialog-actions .primary { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 8px; box-shadow: 0 6px 13px rgba(79,70,229,.2); }
.archive-dialog-actions .primary span { font-size: 16px; line-height: 1; }
.settings-popover { right: -2px; bottom: 60px; left: -2px; padding: 8px; border-color: rgba(221,225,239,.92); border-radius: 15px; background: rgba(255,255,255,.94); box-shadow: 0 18px 42px rgba(30,41,59,.18), 0 2px 8px rgba(30,41,59,.06); backdrop-filter: blur(16px); }
.settings-popover::after { position: absolute; right: 19px; bottom: -6px; width: 11px; height: 11px; border-right: 1px solid rgba(221,225,239,.92); border-bottom: 1px solid rgba(221,225,239,.92); background: #fff; content: ''; transform: rotate(45deg); }
.settings-user { position: relative; gap: 10px; padding: 9px 8px 13px; margin: 0 0 7px; border-color: #eef0f5; }
.settings-popover .settings-avatar { position: relative; width: 38px; height: 38px; overflow: hidden; border: 2px solid rgba(255,255,255,.86); border-radius: 13px; color: #fff; background: linear-gradient(135deg,#818cf8,#4f46e5 58%,#3730a3); box-shadow: 0 4px 10px rgba(79,70,229,.25); font-size: 15px; font-weight: 800; }
.settings-popover .settings-avatar::after { position: absolute; right: -8px; bottom: -9px; width: 23px; height: 23px; border-radius: 50%; background: rgba(255,255,255,.22); content: ''; }
.settings-user-copy { display: grid; min-width: 0; gap: 2px; }
.settings-user-copy strong { overflow: hidden; color: #273244; font-size: 13px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.settings-user-copy span { color: #98a2b3; font-size: 11px; }
.settings-user-more { margin-left: auto; color: #98a2b3; font-size: 17px; }
.settings-menu-links { display: grid; gap: 2px; }
.settings-popover .settings-menu-links button { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 9px 10px; border-radius: 9px; color: #475467; font-size: 13px; font-weight: 650; }
.settings-popover .settings-menu-links button span { flex: 1; }
.settings-popover .settings-menu-links button:hover { color: #4338ca; background: #f2f3ff; }
.settings-popover .settings-logout { display: flex; align-items: center; justify-content: space-between; width: calc(100% - 2px); min-height: 38px; padding: 9px 10px; margin: 7px 1px 1px; border: 0; border-top: 1px solid #eef0f5; border-radius: 0 0 8px 8px; color: #d92d20; background: transparent; font-size: 13px; font-weight: 650; }
.settings-popover .settings-logout:hover { color: #b42318; background: #fff4f3; }
.settings-popover .settings-logout span { color: #f04438; font-size: 16px; transition: transform .16s ease; }.settings-popover .settings-logout:hover span { transform: translateX(2px); }
.settings-button { position: relative; transition: color .16s ease, background .16s ease; }.settings-button:hover { color: #4338ca; }
.ui-icon { width: 17px; height: 17px; flex: 0 0 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.settings-button .ui-icon { width: 16px; height: 16px; flex-basis: 16px; }
.settings-popover .settings-menu-links .ui-icon { color: #667085; }.settings-popover .settings-menu-links button:hover .ui-icon { color: #5b5bd6; }
.note-tab button .ui-icon { display: block; width: 15px; height: 15px; }

/* 便签分组标题与分隔线 */
.tabs-group-title { padding: 16px 10px 6px; color: #98a2b3; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.tabs-divider { height: 1px; margin: 10px; background: #eef0f4; }

/* 便签标签相对定位（下拉菜单定位基准） */
.note-tab { position: relative; }
.note-tab .tab-pin-icon { width: 14px; height: 14px; flex: 0 0 14px; color: #f59e0b; fill: #f59e0b; stroke: #f59e0b; }

/* 更多操作按钮（三个点） */
.note-tab-more { display: none; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent; cursor: pointer; color: #98a2b3; opacity: 1; transition: background .16s ease, color .16s ease; }
.note-tab:hover .note-tab-more, .note-tab.active .note-tab-more { display: flex;position: absolute;top:8px;right:8px}
.note-tab-more:hover { background: #f2f4f7; color: #475467; }
.note-tab-more .ui-icon { width: 16px; height: 16px; }

/* 下拉菜单 */
.note-tab-dropdown { position: absolute; top: calc(100% + 4px); right: 8px; z-index: 50; min-width: 100px; padding: 6px; background: #fff; border: 1px solid #e6e9f0; border-radius: 10px; box-shadow: 0 8px 24px rgba(16,24,40,.12); }
.note-tab-dropdown[hidden] { display: none; }
.note-tab-dropdown button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 7px 10px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; color: #475467; font-size: 13px; font-weight: 500; text-align: left; opacity: 1; transition: background .16s ease, color .16s ease; }
.note-tab-dropdown button:hover { background: #f7f7ff; color: #4338ca; }
.note-tab-dropdown button .ui-icon { width: 15px; height: 15px; flex: 0 0 15px; color: #98a2b3; }
.note-tab-dropdown button:hover .ui-icon { color: #5b5bd6; }
.note-tab-dropdown button span { flex: 1; }
.note-tab-dropdown.drop-up { top: auto; bottom: calc(100% + 4px); }
.mode { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid #e1e5ee; border-radius: 11px; background: rgba(255,255,255,.9); box-shadow: 0 2px 5px rgba(16,24,40,.04); }
.mode button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: auto; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; color: #667085; background: transparent; cursor: pointer; font-size: 12px; font-weight: 650; transition: color .16s ease, background .16s ease, box-shadow .16s ease; }
.mode button .mode-icon { width: 15px; height: 15px; flex-basis: 15px; stroke-width: 1.9; }
.mode button:hover { color: #4f46e5; background: #f7f7ff; }
.mode button.active { color: #4338ca; background: #eeefff;  }
.mode button.active .mode-icon { color: #5b5bd6; }
.markdown-toolbar[hidden] { display: none; }
.copy-preview-mode .editor-header { min-height: 58px; padding-top: 12px; padding-bottom: 10px; }
.copy-preview-mode .note-title, .copy-preview-mode .status { display: none; }
.copy-preview-mode .mode { margin-left: auto; }
.copy-preview-mode .editor-content { padding-top: 0; }
.copy-lines { width: min(900px, calc(100% - 48px)); height: 100%; margin: 0 auto; overflow-y: auto; scrollbar-gutter: stable; }
.copy-lines-list { overflow: hidden; border: 1px solid #e6e9f0; border-radius: 15px; background: #fff; box-shadow: 0 5px 18px rgba(16,24,40,.035); }
.copy-line { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; min-height: 54px; gap: 10px; padding: 8px 12px 8px 0; border-bottom: 1px solid #eef0f4; transition: background .16s ease; }
.copy-line:last-child { border-bottom: 0; }
.copy-line:hover { background: #f8f9ff; }
.copy-line-number { align-self: stretch; display: grid; place-items: center; border-right: 1px solid #eef0f4; color: #a0a8b7; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; user-select: none; }
.copy-line-content { min-width: 0; overflow-wrap: anywhere; color: #263341; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.copy-line-action { padding: 6px 9px; border: 1px solid transparent; border-radius: 7px; color: #5b5bd6; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; opacity: .72; transition: opacity .16s ease, background .16s ease; }
.copy-line:hover .copy-line-action, .copy-line-action:focus-visible { opacity: 1; }
.copy-line-action:hover { border-color: #dfe2ff; background: #eef0ff; }
.copy-lines-empty { display: grid; min-height: 180px; place-items: center; padding: 24px; border: 1px dashed #dfe3ec; border-radius: 15px; color: #98a2b3; background: rgba(255,255,255,.58); text-align: center; font-size: 14px; }
@media(max-width:720px){.mode button{min-width:auto}.copy-lines{width:calc(100% - 32px)}.copy-line{grid-template-columns:32px minmax(0,1fr) auto;gap:7px;padding-right:8px}.copy-line-action{opacity:1}.copy-preview-mode .editor-header{padding-right:16px;padding-left:16px}}
.workspace-panel { background: rgba(15, 23, 42, .46); }
.cherry-toolbar-history, .cherry-toolbar-user-settings { display: inline-grid; width: 30px; height: 30px; place-items: center; border-radius: 7px; color: #667085; cursor: pointer; transition: .16s ease; }
.cherry-toolbar-history:hover, .cherry-toolbar-history:focus-visible, .cherry-toolbar-user-settings:hover, .cherry-toolbar-user-settings:focus-visible { color: #4f46e5; background: #eef0ff; outline: 0; }
.cherry-toolbar-history svg, .cherry-toolbar-user-settings svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.cherry-editor-host { width: min(1200px, calc(100% - 48px)); height: 100%; margin: 0 auto; overflow: hidden; border: 1px solid #e6e9f0; border-radius: 15px; background: #fff; box-shadow: 0 5px 18px rgba(16,24,40,.035); }
.cherry-editor-host .cherry { height: 100% !important; border: 0; }
.cherry-editor-host .cherry-toolbar { border-color: #edf0f5; background: #fcfcfe; }
.cherry-editor-host .cherry-tool-button { border-radius: 7px; }
.cherry-editor-host .cherry-tool-button:hover { background: #eef0ff; }
.cherry-editor-host .cherry-previewer, .cherry-editor-host .cherry-editor { scrollbar-gutter: stable; }
.history-dialog-card { width: min(520px, calc(100% - 32px)); padding: 0; overflow: hidden; background: linear-gradient(145deg,#fff,#f9faff); transition: width .18s ease; }
.history-dialog-card.history-compare-mode { width: min(1120px, calc(100% - 48px)); }
.history-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 24px 18px; border-bottom: 1px solid #eaecf3; }
.history-dialog-heading p { margin: 0 0 4px; color: #6366f1; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.history-dialog-heading h2 { margin: 0; font-size: 19px; }
.history-list { max-height:680px; overflow: auto; padding: 10px; }
.history-item { display: flex; width: 100%; align-items: center; gap: 13px; padding: 13px; border: 0; border-radius: 11px; background: transparent; cursor: pointer; text-align: left; }
.history-item:hover { background: #f2f3ff; }
.history-version { display: grid; width: 38px; height: 30px; flex: 0 0 auto; place-items: center; border: 1px solid #dfe2ff; border-radius: 8px; color: #4f46e5; background: #f0f1ff; font-size: 11px; font-weight: 800; }
.history-item-copy { display: grid; min-width: 0; gap: 4px; }.history-item strong { overflow: hidden; color: #344054; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }.history-item-copy span { color: #98a2b3; font-size: 12px; }.history-compare-action { margin-left: auto; color: #5b5bd6; font-size: 12px; font-weight: 700; opacity: 0; transition: opacity .16s ease; }.history-item:hover .history-compare-action, .history-item:focus-visible .history-compare-action { opacity: 1; }
.history-loading, .history-empty { display: grid; min-height: 170px; place-content: center; gap: 10px; color: #98a2b3; text-align: center; font-size: 13px; }.history-loading { display: flex; align-items: center; }.history-loading span { width: 17px; height: 17px; border: 2px solid #dfe2ff; border-top-color: #6366f1; border-radius: 50%; animation: history-spin .7s linear infinite; }.history-empty span { font-size: 12px; } @keyframes history-spin { to { transform: rotate(360deg); } }
.toolbar-settings-card { width: min(740px, calc(100% - 32px)); padding: 0; overflow: hidden; background: linear-gradient(145deg,#fff,#fafbff); }.toolbar-settings-heading { display: flex; justify-content: space-between; gap: 20px; padding: 22px 24px 18px; border-bottom: 1px solid #eaecf3; }.toolbar-settings-heading p { margin: 0 0 4px; color: #6366f1; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }.toolbar-settings-heading h2 { margin: 0; color: #182230; font-size: 19px; }.toolbar-settings-heading div > span { display: block; margin-top: 6px; color: #98a2b3; font-size: 12px; }.toolbar-settings-list { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); max-height: min(50vh,420px); gap: 5px; overflow: auto; padding: 16px 20px; }.toolbar-setting-item { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 36px; padding: 7px 9px; border: 1px solid transparent; border-radius: 8px; color: #475467; cursor: pointer; font-size: 12px; font-weight: 600; }.toolbar-setting-item:hover { border-color: #e1e3ff; background: #f5f5ff; }.toolbar-setting-item input { width: 15px; height: 15px; accent-color: #4f46e5; }.toolbar-setting-item:has(input:checked) { color: #4338ca; background: #f0f1ff; }.toolbar-settings-actions { display: flex; align-items: center; gap: 10px; padding: 16px 22px 20px; border-top: 1px solid #eaecf3; }.toolbar-settings-actions > span { flex: 1; }.toolbar-settings-actions button { min-height: 36px; padding: 0 13px; border: 1px solid #dfe3ec; border-radius: 8px; color: #475467; background: #fff; cursor: pointer; font-size: 13px; font-weight: 650; }.toolbar-settings-actions button:hover { background: #f8fafc; }.toolbar-settings-actions .primary { border-color: #4f46e5; color: #fff; background: #4f46e5; box-shadow: 0 5px 12px rgba(79,70,229,.2); }.toolbar-settings-actions .primary:disabled { cursor: wait; opacity: .72; }
.history-compare-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 2px 14px; color: #98a2b3; font-size: 12px; }.history-back { border: 0; border-radius: 7px; color: #5b5bd6; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; }.history-back:hover { background: #f0f1ff; }.history-title-compare, .history-diff { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }.history-title-compare { margin-bottom: 12px; }.history-title-compare > div { display: grid; gap: 5px; min-width: 0; padding: 12px 13px; border: 1px solid #e8ebf1; border-radius: 10px; background: #fff; }.history-title-compare span { color: #98a2b3; font-size: 11px; font-weight: 700; }.history-title-compare strong { overflow: hidden; color: #344054; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }.history-title-compare .diff-title-current { border-color: #ffd8d4; background: #fff9f8; }.history-title-compare .diff-title-version { border-color: #cee7da; background: #f5fcf8; }.history-diff section { min-width: 0; overflow: hidden; border: 1px solid #e8ebf1; border-radius: 11px; background: #fff; }.history-diff header { display: flex; align-items: baseline; gap: 8px; padding: 11px 13px; border-bottom: 1px solid #eef0f4; color: #475467; font-size: 12px; font-weight: 750; }.history-diff header small { color: #98a2b3; font-size: 11px; font-weight: 500; }.diff-lines { max-height: min(43vh,430px); overflow: auto; padding: 7px 0; }.diff-line { display: grid; grid-template-columns: 38px minmax(0,1fr); min-height: 25px; font-family: ui-monospace,SFMono-Regular,Menlo,monospace; font-size: 12px; line-height: 1.65; }.diff-line > span { padding: 2px 8px; color: #a0a8b7; background: #fafbfc; text-align: right; user-select: none; }.diff-line code { padding: 2px 10px; overflow-wrap: anywhere; white-space: pre-wrap; }.diff-line-current > span, .diff-line-current code { background: #fff0ee; }.diff-line-version > span, .diff-line-version code { background: #eaf8ef; }.history-compare-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; }.history-compare-actions button { min-height: 36px; padding: 0 13px; border: 1px solid #dfe3ec; border-radius: 8px; color: #475467; background: #fff; cursor: pointer; font-size: 13px; font-weight: 650; }.history-compare-actions .primary { border-color: #4f46e5; color: #fff; background: #4f46e5; box-shadow: 0 5px 12px rgba(79,70,229,.2); }
.workspace-panel-card { display: grid; grid-template-rows: 68px minmax(0,1fr); width: min(1180px,100%); height: min(840px,calc(100vh - 64px)); overflow: hidden; border: 1px solid rgba(255,255,255,.65); border-radius: 18px; background: #f7f8fc; box-shadow: 0 32px 90px rgba(15,23,42,.36); }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 0 18px 0 22px; border-bottom: 1px solid #e7eaf0; background: rgba(255,255,255,.94); }.panel-header div { display: grid; gap: 2px; }.panel-header span { color: #667085; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }.panel-header strong { color: #182230; font-size: 16px; letter-spacing: -.2px; }.workspace-panel iframe { min-height: 0; background: #f7f8fc; }.panel-close { position: static; width: 36px; height: 36px; border-color: #e4e7ec; border-radius: 10px; background: #f8fafc; transition: .16s ease; }.panel-close:hover { transform: rotate(90deg); box-shadow: 0 3px 8px rgba(15,23,42,.1); }
.obsidian-sync-card { width: min(470px,calc(100% - 32px)); padding: 0; overflow: hidden; border: 1px solid #e4e5f5; border-radius: 18px; background: linear-gradient(145deg,#fff 0%,#f6f5ff 100%); box-shadow: 0 28px 75px rgba(31,35,73,.26); }.obsidian-sync-heading { display: flex; align-items: flex-start; gap: 13px; padding: 24px 24px 19px; border-bottom: 1px solid #e7e8f3; }.obsidian-sync-mark { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(145deg,#6d5ce7,#393078); box-shadow: 0 7px 18px rgba(72,59,167,.28); font-size: 23px; font-weight: 300; }.obsidian-sync-heading p { margin: 1px 0 4px; color: #7367da; font-size: 10px; font-weight: 800; letter-spacing: .13em; }.obsidian-sync-heading h2 { margin: 0; color: #202038; font-size: 19px; letter-spacing: -.3px; }.obsidian-sync-heading div > span { display: block; margin-top: 5px; color: #7c7e95; font-size: 12px; line-height: 1.5; }.obsidian-field { display: grid; gap: 7px; padding: 20px 24px 0; color: #52546d; font-size: 12px; font-weight: 700; }.obsidian-field input, .obsidian-token-result input { width: 100%; min-width: 0; height: 38px; box-sizing: border-box; border: 1px solid #dfe0ec; border-radius: 9px; outline: 0; padding: 0 11px; color: #55576b; background: #fbfbfe; font: 12px ui-monospace,SFMono-Regular,Menlo,monospace; }.obsidian-token-actions { padding: 15px 24px 18px; }.obsidian-token-actions button { min-height: 37px; padding: 0 14px; border: 0; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 700; }.obsidian-token-result { display: grid; gap: 8px; margin: 0 24px 20px; padding: 14px; border: 1px solid #dfe0fb; border-radius: 11px; background: rgba(243,243,255,.76); }.obsidian-token-result > span { color: #5147ac; font-size: 12px; font-weight: 800; }.obsidian-token-result > div { display: flex; gap: 7px; }.obsidian-token-result button { width: 48px; flex: 0 0 auto; border: 1px solid #d3d4e8; border-radius: 8px; color: #4e4792; background: #fff; cursor: pointer; font-size: 12px; font-weight: 700; }.obsidian-token-result small { color: #77798e; font-size: 11px; line-height: 1.55; }.obsidian-sync-footer { justify-content: flex-end; margin: 0; padding: 14px 24px 19px; border-top: 1px solid #e7e8f3; }.obsidian-sync-footer button { min-height: 34px; padding: 0 13px; border: 1px solid #dfe0e9; border-radius: 8px; color: #595d72; background: #fff; cursor: pointer; font-size: 13px; font-weight: 650; }

/* AI API Key 管理面板 */
.ai-key-card { width: min(560px, calc(100% - 32px)); padding: 0; overflow: hidden; border: 1px solid #e4e5f5; border-radius: 18px; background: linear-gradient(145deg, #fff 0%, #f6f5ff 100%); box-shadow: 0 28px 75px rgba(31,35,73,.26); }
.ai-key-heading { display: flex; align-items: flex-start; gap: 13px; padding: 24px 24px 19px; border-bottom: 1px solid #e7e8f3; }
.ai-key-mark { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(145deg, #6d5ce7, #393078); box-shadow: 0 7px 18px rgba(72,59,167,.28); font-size: 20px; }
.ai-key-heading p { margin: 1px 0 4px; color: #7367da; font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.ai-key-heading h2 { margin: 0; color: #202038; font-size: 19px; letter-spacing: -.3px; }
.ai-key-heading div > span { display: block; margin-top: 5px; color: #7c7e95; font-size: 12px; line-height: 1.5; }
.ai-key-create-row { display: flex; gap: 10px; padding: 18px 24px 14px; }
.ai-key-create-row input { flex: 1; height: 40px; padding: 0 12px; border: 1px solid #dfe0ec; border-radius: 9px; outline: 0; color: #55576b; background: #fbfbfe; font-size: 13px; }
.ai-key-create-row select { height: 40px; padding: 0 10px; border: 1px solid #dfe0ec; border-radius: 9px; outline: 0; color: #55576b; background: #fbfbfe; font-size: 13px; cursor: pointer; }
.ai-key-create-row input:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,.13); }
.ai-key-create-row .primary { min-height: 40px; padding: 0 16px; border: 0; border-radius: 9px; color: #fff; background: #4f46e5; cursor: pointer; font-size: 13px; font-weight: 700; box-shadow: 0 5px 12px rgba(79,70,229,.2); white-space: nowrap; }
.ai-key-create-row .primary:disabled { cursor: wait; opacity: .72; }
.ai-key-list { max-height: 320px; overflow-y: auto; padding: 0 24px; }
.ai-key-item { padding: 14px 0; border-bottom: 1px solid #eef0f4; }
.ai-key-item:last-child { border-bottom: 0; }
.ai-key-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ai-key-item-header strong { color: #202038; font-size: 14px; }
.ai-key-scope { padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.ai-key-scope.read { color: #667085; background: #f2f4f7; }
.ai-key-scope.write { color: #b54708; background: #fef3c7; }
.ai-key-delete { padding: 4px 10px; border: 1px solid #f3c7c4; border-radius: 7px; color: #d92d20; background: transparent; cursor: pointer; font-size: 12px; font-weight: 600; transition: background .16s ease; }
.ai-key-delete:hover { background: #fff4f3; }
.ai-key-item-value { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #e6e8ff; border-radius: 9px; background: #f7f7ff; }
.ai-key-item-value code { flex: 1; overflow: hidden; color: #4e4792; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ai-key-copy { padding: 4px 10px; border: 1px solid #d3d4e8; border-radius: 7px; color: #4e4792; background: #fff; cursor: pointer; font-size: 12px; font-weight: 700; transition: background .16s ease; white-space: nowrap; }
.ai-key-copy:hover { background: #eef0ff; }
.ai-key-item-meta { display: flex; gap: 16px; margin-top: 8px; color: #98a2b3; font-size: 11px; }
.ai-key-loading, .ai-key-empty { padding: 24px; text-align: center; color: #98a2b3; font-size: 13px; }
.ai-key-tip { padding: 14px 24px; border-top: 1px solid #e7e8f3; color: #7c7e95; font-size: 12px; line-height: 1.6; }
.ai-key-tip p { margin: 4px 0; }
.ai-key-tip code { padding: 1px 5px; border: 1px solid #eceef5; border-radius: 5px; background: #e8e9ec; color: #4e4792; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.ai-key-footer { justify-content: flex-end; margin: 0; padding: 14px 24px 18px; border-top: 1px solid #f0f1f5; }
.ai-key-footer button { min-height: 36px; padding: 0 13px; border: 1px solid #dfe3ec; border-radius: 8px; color: #475467; background: #fff; cursor: pointer; font-size: 13px; font-weight: 650; }
.ai-key-footer button:hover { background: #f8fafc; }
.cm-live-preview-callout { --callout-accent: #64748b; --callout-surface: #f8fafc; --callout-border: #e2e8f0; display: block !important; box-sizing: border-box; margin: 8px 0 !important; padding: 0 !important; overflow: hidden; border: 1px solid var(--callout-border); border-left: 3px solid var(--callout-accent); border-radius: 8px; background: #fff; box-shadow: none; }
.cm-live-preview-callout::before { display: none; }
.cm-live-preview-callout .cherry-panel { display: block; min-height: 0 !important; height: auto !important; margin: 0 !important; padding: 0 !important; border: 0; background: transparent; }
.cm-live-preview-callout .cherry-panel--title { position: static; box-sizing: border-box; width: 100%; min-height: 34px; padding: 8px 12px; }
.cm-live-preview-callout .cherry-panel--body { position: static; box-sizing: border-box; min-height: 42px; padding: 10px 12px; font-size: 14px; line-height: 1.6; }
.cm-live-preview-callout .cherry-panel--body p { min-height: 1.6em !important; margin: 0 !important; padding: 0; line-height: inherit; }
.cherry-editor-host .cm-editor .cm-line { min-height: 1.6em; }
.cherry-editor-host .cm-live-preview { display: flow-root; box-sizing: border-box; padding: 0; line-height: 1.6; }
.cherry-editor-host .cm-live-preview h1, .cherry-editor-host .cm-live-preview h2, .cherry-editor-host .cm-live-preview h3, .cherry-editor-host .cm-live-preview h4, .cherry-editor-host .cm-live-preview h5, .cherry-editor-host .cm-live-preview h6 { margin: 0; padding: 6px 0 3px; line-height: 1.3; }
.cherry-editor-host .cm-live-preview h1 { padding-bottom: 7px; }
.cherry-editor-host .cm-live-preview p { margin: 0; padding: 2px 0; }
.cherry-editor-host .cm-live-preview ul, .cherry-editor-host .cm-live-preview ol { margin: 0; }
.cherry-editor-host .cm-live-preview blockquote, .cherry-editor-host .cm-live-preview pre { margin: 2px 0; }
.cherry-editor-host .cm-live-preview hr { margin: 4px 0; }
.cherry-wysiwyg-host .cherry-editor,
.cherry-wysiwyg-host .cherry-drag,
.cherry-wysiwyg-host .cherry-editor-mask { display: none !important; }
.cherry-wysiwyg-host .cherry-previewer { width: 100% !important; }
.cherry-wysiwyg-host .cherry-markdown[contenteditable='true'] { min-height: 100%; outline: 0; caret-color: var(--editor-cursor-color, #3582fb); }
.cherry-wysiwyg-host .cherry-markdown[contenteditable='true']:focus { box-shadow: inset 3px 0 0 rgba(53,130,251,.42); }
.cm-live-preview-callout:has(.cherry-panel__info) { --callout-accent: #3b82b6; --callout-surface: #f0f7fb; --callout-border: #cfe2ed; }.cm-live-preview-callout:has(.cherry-panel__success) { --callout-accent: #31906d; --callout-surface: #f0f9f5; --callout-border: #cce8d9; }.cm-live-preview-callout:has(.cherry-panel__warning) { --callout-accent: #c9821d; --callout-surface: #fff8eb; --callout-border: #f0ddb4; }.cm-live-preview-callout:has(.cherry-panel__danger) { --callout-accent: #c85b61; --callout-surface: #f0d1d4; }.cm-live-preview-callout:has(.cherry-panel__primary) { --callout-accent: #7060c8; --callout-surface: #f6f4ff; --callout-border: #ddd7f5; }

@media (max-width: 720px) {
  html, body { overflow: auto; }
  .app-main { height: auto; min-height: 100dvh; padding: 0; }
  .workspace { height: auto; min-height: 100dvh; }
  .sidebar, .editor { height: auto; }
  .tabs { overflow-y: hidden; }
  .markdown-toolbar,
  .editor-content > .editable-preview,
  .editor-content > .lines,
  .editor-content > .empty-action { width: calc(100% - 32px); }
  .editor-content { padding-bottom: 15px; }
  .editor-content { overflow: auto; }
  .dialog { padding: 0; }
  .archive-dialog-card { width: min(466px,calc(100% - 28px)); }
  .archive-dialog-heading { padding: 22px 20px 18px; }
  .archive-dialog-fields { padding: 20px 20px 16px; }
  .archive-dialog-tip { margin: 0 20px; }
  .archive-dialog-actions { padding: 16px 20px 20px; }
  .toolbar-settings-card { width: min(100%, calc(100% - 20px)); }
  .toolbar-settings-list { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 14px; }
  .toolbar-settings-heading { padding: 20px 18px 16px; }
  .toolbar-settings-actions { padding: 14px 16px 16px; }
  .workspace-panel-card { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  .panel-header { padding: 0 14px; }
}

/* Milkdown 编辑器：工具栏和正文共用一张紧凑的文档卡片。 */
.editor-content:has(> .milkdown-container) { display: block;overflow: hidden; }
.editor-content > .milkdown-container {
  max-height: 100%;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #e1e6ef;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(31, 41, 55, .045);
  scrollbar-gutter: stable;
}
.editor-content > .milkdown-container > .milkdown {
  height: 100%;
  min-height: 0;
  flex-direction: column;
  background: #fff;
}
.editor-content > .milkdown-container > .milkdown > .editor {
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  background: #fff;
  scrollbar-gutter: stable;
}
.editor-content > .milkdown-container.milkdown {
  --crepe-color-background: #fff;
  --crepe-color-on-background: #263341;
  --crepe-color-surface: #fbfcff;
  --crepe-color-surface-low: #f3f5fa;
  --crepe-color-on-surface: #344054;
  --crepe-color-on-surface-variant: #667085;
  --crepe-color-outline: #8b95a7;
  --crepe-color-primary: #4f46e5;
  --crepe-color-secondary: #e9ebff;
  --crepe-color-hover: #f0f2ff;
  --crepe-color-selected: #e5e8ff;
  --crepe-color-inline-area: #eef1f7;
  --crepe-color-inline-code: #b54708;
  --crepe-font-default: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  --crepe-font-title: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
  --crepe-font-code: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --crepe-shadow-1: 0 10px 24px rgba(31, 41, 55, .12), 0 2px 6px rgba(31, 41, 55, .06);
  --crepe-shadow-2: 0 18px 44px rgba(31, 41, 55, .17), 0 3px 10px rgba(31, 41, 55, .06);
}
.editor-content > .milkdown-container .milkdown-top-bar {
  flex: 0 0 auto;
  min-height: 50px;
  padding: 5px 10px;
  overflow: visible;
  border-bottom: 1px solid #e6eaf1;
  background: #fafbfe;
  box-shadow: none;
}
.editor-content > .milkdown-container .milkdown-top-bar .top-bar-inner {
  width: 100%;
  flex-wrap: wrap;
  gap: 2px;
}
.editor-content > .milkdown-container .milkdown-top-bar .top-bar-divider {
  height: 20px;
  margin: 0 6px;
  background: #e3e7ef;
}
.editor-content > .milkdown-container .milkdown-top-bar .top-bar-heading-selector { padding: 3px; }
.editor-content > .milkdown-container .milkdown-top-bar .top-bar-heading-button {
  height: 32px;
  padding: 4px 5px 4px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.editor-content > .milkdown-container .milkdown-top-bar .top-bar-heading-button:hover,
.editor-content > .milkdown-container .milkdown-top-bar .top-bar-heading-button:focus-visible {
  border-color: #dde2ff;
  background: #f1f3ff;
}
.editor-content > .milkdown-container .milkdown-top-bar .top-bar-heading-button .top-bar-heading-label { min-width: 62px; color: #475467; font-size: 12px; }
.editor-content > .milkdown-container .milkdown-top-bar .top-bar-heading-button .top-bar-chevron { width: 20px; }
.editor-content > .milkdown-container .milkdown-top-bar .top-bar-heading-dropdown {
  top: calc(100% + 6px);
  left: 2px;
  min-width: 168px;
  padding: 6px;
  border: 1px solid #e1e5ee;
  border-radius: 11px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 15px 34px rgba(31,41,55,.15);
}
.editor-content > .milkdown-container .milkdown-top-bar .top-bar-heading-option { padding: 8px 10px; border-radius: 7px; color: #475467; font-size: 13px; }
.editor-content > .milkdown-container .milkdown-top-bar .top-bar-heading-option:hover { background: #f2f4ff; }
.editor-content > .milkdown-container .milkdown-top-bar .top-bar-heading-option.active { color: #4338ca; background: #eef0ff; }
.editor-content > .milkdown-container .milkdown-top-bar .top-bar-item {
  width: 30px;
  height: 30px;
  padding: 5px;
  margin: 2px 1px;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: transform .14s ease, background .14s ease, border-color .14s ease;
}
.editor-content > .milkdown-container .milkdown-top-bar .top-bar-item:hover,
.editor-content > .milkdown-container .milkdown-top-bar .top-bar-item:focus-visible {
  border-color: #dde2ff;
  background: #f0f2ff;
  transform: translateY(-1px);
}
.editor-content > .milkdown-container .milkdown-top-bar .top-bar-item:active { transform: translateY(0); background: #e7eaff; }
.editor-content > .milkdown-container .milkdown-top-bar .top-bar-item svg { width: 18px; height: 18px; color: #667085; fill: #667085; }
.editor-content > .milkdown-container .milkdown-top-bar .top-bar-item.active { border-color: #d7dcff; background: #e8eaff; }
.editor-content > .milkdown-container .milkdown-top-bar .top-bar-item.active svg { color: #4f46e5; fill: #4f46e5; }
.editor-content > .milkdown-container .ProseMirror {
  min-height: 100%;
  padding:10px 30px 45px 50px;
  color: #2d3948;
  font-size: 16px;
  line-height: 1.82;
  caret-color: #4f46e5;
}
.editor-content > .milkdown-container .ProseMirror h1,
.editor-content > .milkdown-container .ProseMirror h2,
.editor-content > .milkdown-container .ProseMirror h3,
.editor-content > .milkdown-container .ProseMirror h4,
.editor-content > .milkdown-container .ProseMirror h5,
.editor-content > .milkdown-container .ProseMirror h6 { color: #1f57a5; font-weight: 700; letter-spacing: -.025em; }
.editor-content > .milkdown-container strong,.editor-content > .milkdown-container em{color:#dd7878}
.editor-content > .milkdown-container .ProseMirror h1:first-child,
.editor-content > .milkdown-container .ProseMirror h2:first-child,
.editor-content > .milkdown-container .ProseMirror h3:first-child { margin-top: 0; }
.editor-content > .milkdown-container .ProseMirror blockquote { margin: 14px 0; padding: 4px 0 4px 20px; color: #667085;   background: linear-gradient(90deg, #e5eaff 0%, #f1f3ff 100%);}
.editor-content > .milkdown-container .ProseMirror blockquote::before { width: 3px; border-radius: 4px; background:#7287fd;   }
.editor-content > .milkdown-container .ProseMirror code { padding: 1px 5px; border: 1px solid #eceef5; border-radius: 5px; background: #e8e9ec; font-size: .86em; }
.editor-content > .milkdown-container .ProseMirror pre { margin: 16px 0; padding: 18px 20px; border: 1px solid #e6e9f1; border-radius: 11px; background: #f7f8fc; box-shadow: inset 0 1px rgba(255,255,255,.75); }
.editor-content > .milkdown-container .ProseMirror pre code { padding: 0; border: 0; background: transparent; }
.editor-content > .milkdown-container .ProseMirror hr { margin: 26px 0; }
.editor-content > .milkdown-container .ProseMirror th { background: #f0f0f0; color: #000000; font-weight: 700; }
.editor-content > .milkdown-container .ProseMirror th,
.editor-content > .milkdown-container .ProseMirror td { border-color: #e5e8f0;}
.editor-content > .milkdown-container .ProseMirror .crepe-placeholder::after { color: #a6aebd; font-style: normal; }
.editor-content > .milkdown-container .ProseMirror-focused { box-shadow: inset 3px 0 0 rgba(99, 102, 241, .26); }

@media (max-width: 720px) {
  .editor-content:has(> .milkdown-container) { padding-bottom: 10px; }
  .editor-content > .milkdown-container { width: calc(100%); height: min(560px, calc(100dvh - 216px)); min-height: 360px; max-height: 560px; border-radius: 12px; }
  .editor-content > .milkdown-container .milkdown{width: calc(100%);}
  .editor-content > .milkdown-container .milkdown-top-bar { min-height: 50px; padding: 5px 8px; }
  .editor-content > .milkdown-container .milkdown-top-bar .top-bar-inner { width: 100%; flex-wrap: wrap; }
  .editor-content > .milkdown-container .milkdown-top-bar .top-bar-divider { margin: 0 5px; }
  .editor-content > .milkdown-container .milkdown-top-bar .top-bar-heading-button .top-bar-heading-label { min-width: 58px; }
  .editor-content > .milkdown-container .ProseMirror { min-height: 100%; padding: 22px 20px 40px; font-size: 15px; }
  .editor-content > .milkdown-container .ProseMirror h1 { margin-top: 32px; font-size: 2em; }
  .editor-content > .milkdown-container .ProseMirror h2 { margin-top: 28px; font-size: 1.58em; }
}

@media (prefers-reduced-motion: reduce) {
  .editor-content > .milkdown-container .milkdown-top-bar .top-bar-item,
  .editor-content > .milkdown-container .milkdown-top-bar .top-bar-heading-button { transition: none; }
}
