/* ============================================================================
   iFolo 面板 —— 真机样式的原样抽取
   ----------------------------------------------------------------------------
   来源：packages/editor/src/app.css（v0.1.0 已安装版本）
   处理：只删掉全局重置（*、html/body、body{}），因为站点本身要用 document 流；
        把 #app 重命名为 .ifp-shell，避免与页面 ID 冲突。
   其余规则一字未改 —— 这是「1:1 像素级还原」的前提。
   ========================================================================= */

.ifp-shell,
.ifp-shell *,
.ifp-shell *::before,
.ifp-shell *::after {
  box-sizing: border-box;
  scrollbar-width: none;
}
.ifp-shell *::-webkit-scrollbar { display: none; width: 0; height: 0; }

.ifp-shell {
  font-family: var(--font-ui);
  font-size: var(--t-chrome);
  line-height: var(--t-chrome-lh);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
}

/* ============================================================================
   iFolo 面板与编辑器样式
   ========================================================================= */








/* ============================================================================
   面板外壳
   ========================================================================= */

.ifp-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--panel-bg);
  border-radius: var(--panel-radius);
  overflow: hidden;
  border: none;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.10);
  transform: translateZ(0);
}

/* ---------- 顶栏 36px ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  height: var(--topbar-h);
  padding: 0 var(--sp-5);
  flex: 0 0 auto;
  border-bottom: 1px solid var(--bar-border);
}

.topbar__logo {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: transform var(--dur-hover) var(--ease-out), opacity var(--dur-hover);
}

.topbar__logo:hover {
  opacity: 0.8;
  transform: scale(1.06);
}

.topbar__logo svg,
.topbar__logo img {
  width: 19px;
  height: 19px;
  display: block;
  flex-shrink: 0;
}

.topbar__title {
  font-size: var(--t-control);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: var(--r-sm);
  padding: 2px 4px;
  margin-left: -4px;
  transition: background var(--dur-hover), color var(--dur-hover);
}

.topbar__title:hover {
  background: var(--hover-bg);
}

.topbar__count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-left: -3px;
}

.topbar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ---------- 图标按钮 25px ---------- */
.ibtn {
  width: 25px;
  height: 25px;
  border: none;
  border-radius: var(--r-lg);
  background: transparent;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  padding: 0;
  transition: background var(--dur-hover) var(--ease-out),
              color var(--dur-hover) var(--ease-out);
}

.ibtn:hover { background: var(--hover-bg); color: var(--text-primary); }
.ibtn:active { background: var(--active-bg); }
.ibtn--accent {
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  color: #fff;
  box-shadow: 0 2px 6px rgba(75, 107, 251, 0.32);
}
.ibtn--accent:hover {
  background: linear-gradient(135deg, var(--blue-400), var(--blue-600));
  color: #fff;
  box-shadow: 0 3px 8px rgba(75, 107, 251, 0.4);
}

.ibtn svg { display: block; }
.ibtn--active {
  background: var(--accent-subtle);
  color: var(--accent);
}

.topbar__nav-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  border: none;
  background: transparent;
  padding: 3px 6px;
  margin-left: -6px;
  border-radius: var(--r-md);
  cursor: default;
  font-family: inherit;
  transition: background var(--dur-hover);
}

.topbar__nav-btn:hover {
  background: var(--hover-bg);
}

/* ---------- 标签页条（支持无限标签与平滑横向滚动） ---------- */
.tabstrip {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px 11px;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--bar-border);
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tabstrip::-webkit-scrollbar {
  display: none;
}

.tabstrip__tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3.5px 8px;
  border-radius: var(--r-sm);
  background: var(--control-bg);
  border: var(--control-border);
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: default;
  font-family: inherit;
  position: relative;
  max-width: 125px;
  min-width: 0;
  transition: background var(--dur-hover) var(--ease-out), color var(--dur-hover);
}

.tabstrip__tab-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tabstrip__tab:hover {
  background: var(--control-bg-hover);
  border-color: var(--control-border-color-hover);
}

.tabstrip__tab--active {
  background: var(--accent-subtle) !important;
  border-color: var(--accent-border) !important;
  color: var(--accent) !important;
}

.tabstrip__tab--active:hover {
  background: var(--accent-subtle) !important;
}

.tabstrip__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  font-style: normal;
  font-size: 11px;
  line-height: 1;
  color: inherit;
  opacity: 0.45;
  transition: opacity var(--dur-hover), background var(--dur-hover);
}

.tabstrip__tab:hover .tabstrip__close {
  opacity: 0.75;
}

.tabstrip__close:hover {
  opacity: 1 !important;
  background: var(--hover-bg);
}

.tabstrip__tab--add {
  flex-shrink: 0;
  background: transparent;
  color: var(--text-tertiary);
  font-weight: 700;
  padding: 3px 7px;
}

.tabstrip__tab--add:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

/* ============================================================================
   编辑器页面内搜索栏
   ========================================================================= */

/* ============================================================================
   编辑器页面内搜索栏（尺寸与样式与首页主面板 notelist__search-wrap 100% 绝对一致）
   ========================================================================= */

.editor-search-bar {
  flex: 0 0 auto;
  position: relative;
  z-index: 200;
}

.editor-search-commands {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: var(--popover-bg);
  border: var(--popover-border);
  backdrop-filter: var(--popover-backdrop);
  -webkit-backdrop-filter: var(--popover-backdrop);
  border-radius: 11px;
  box-shadow: var(--shadow-popover);
  z-index: 200;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
}

.editor-search-count {
  font-size: 11px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  user-select: none;
  flex-shrink: 0;
  margin-right: 2px;
  padding: 1px 6px;
  background: var(--control-bg);
  border: var(--control-border);
  border-radius: var(--r-sm);
}

/* ProseMirror 页面内搜索高亮 */
.search-highlight {
  background-color: var(--search-match-bg);
  border-radius: 2px;
  box-shadow: 0 0 0 1px var(--search-match-border);
  color: var(--search-match-color);
  transition: background-color 0.15s ease;
}

.search-highlight--active {
  background-color: var(--search-active-bg) !important;
  color: var(--search-active-color) !important;
  box-shadow: 0 0 0 2px var(--search-active-border) !important;
  font-weight: 600;
}
/* ============================================================================
   富文本工具栏 34px
   ========================================================================= */

.toolbar {
  display: flex;
  align-items: center;
  gap: 1px;
  height: var(--toolbar-h);
  padding: 0 7px;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--bar-border);
  overflow: hidden;
}

.toolbar__block {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  margin-right: 3px;
  border: var(--control-border);
  border-radius: var(--r-sm);
  background: var(--control-bg);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: default;
  flex: 0 0 auto;
}

.toolbar__sep {
  width: 1px;
  height: 14px;
  margin: 0 4px;
  background: var(--bar-border);
  flex: 0 0 auto;
}

.toolbar__btn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  padding: 0;
  flex: 0 0 auto;
  font-family: inherit;
  transition: background var(--dur-hover) var(--ease-out);
}

.toolbar__btn:hover { background: var(--hover-bg); color: var(--text-primary); }
.toolbar__btn--on { background: var(--accent-subtle); color: var(--accent); }
.toolbar__btn--b { font-weight: 800; font-size: 12px; color: var(--text-primary); }
.toolbar__btn--i { font-family: Georgia, serif; font-style: italic; font-size: 13.5px; }
.toolbar__btn--u { font-size: 12px; text-decoration: underline; text-underline-offset: 2px; }
.toolbar__btn--s { font-size: 12px; text-decoration: line-through; }
.toolbar__btn--mono { font-family: var(--font-mono); font-size: 10.5px; }

.toolbar__more {
  margin-left: auto;
  color: var(--text-tertiary);
  font-size: 14px;
  letter-spacing: 1px;
}

/* ============================================================================
   编辑器
   ========================================================================= */

.editor-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  -webkit-user-select: text;
  user-select: text;
}


.editor-crumb {
  font-size: 10.5px;
  color: var(--text-tertiary);
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  -webkit-user-select: none;
  user-select: none;
}

.editor-crumb .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border-strong);
  display: inline-block;
  flex-shrink: 0;
}

.editor-crumb__item {
  color: var(--text-tertiary);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-crumb__item--link {
  cursor: pointer;
  transition: color var(--dur-hover);
}

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

.editor-wrap {
  position: relative;
  padding: 13px 15px 40px;
}

.ProseMirror {
  outline: none;
  font-size: var(--t-body);
  line-height: var(--t-body-lh);
  color: var(--text-primary);
  min-height: 200px;
}

.ProseMirror > * + * { margin-top: var(--paragraph-spacing); }

.ProseMirror p {
  margin: 0;
  font-size: var(--t-body);
  line-height: var(--t-body-lh);
  color: var(--text-secondary);
}

.ProseMirror h1 {
  font-size: var(--t-h1);
  font-weight: var(--t-h1-w);
  line-height: var(--t-h1-lh);
  letter-spacing: var(--t-h1-tr);
  color: var(--text-primary);
  margin: 0;
}
.ProseMirror > * + h1 {
  margin-top: 32px !important;
}
.ProseMirror > h1:first-child {
  margin-top: 0 !important;
}
.ProseMirror > h1 + * {
  margin-top: 12px !important;
}

.ProseMirror h2 {
  font-size: var(--t-h2);
  font-weight: var(--t-h2-w);
  line-height: var(--t-h2-lh);
  letter-spacing: var(--t-h2-tr);
  color: var(--text-primary);
  margin: 0;
}
.ProseMirror > * + h2 {
  margin-top: 26px !important;
}
.ProseMirror > h2 + * {
  margin-top: 8px !important;
}

.ProseMirror h3 {
  font-size: var(--t-h3);
  font-weight: var(--t-h3-w);
  line-height: var(--t-h3-lh);
  letter-spacing: var(--t-h3-tr);
  color: var(--text-primary);
  margin: 0;
}
.ProseMirror > * + h3 {
  margin-top: 20px !important;
}
.ProseMirror > h3 + * {
  margin-top: 6px !important;
}

.ProseMirror ul, .ProseMirror ol { margin: 0; padding-left: 22px; font-size: var(--t-body); line-height: var(--t-body-lh); color: var(--text-secondary); }
.ProseMirror li { margin: 2px 0; }
.ProseMirror li p { margin: 0; }

.ProseMirror blockquote {
  margin: 0;
  padding: 2px 0 2px 13px;
  border-left: 3px solid var(--border);
  font-size: var(--t-body);
  line-height: var(--t-body-lh);
  color: var(--text-secondary);
}

.ProseMirror hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 6px 0;
}

.ProseMirror code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--ink-100);
  border: 1px solid var(--border-subtle);
  color: var(--ink-800);
  padding: 1.5px 5px;
  border-radius: var(--r-xs);
}

.ProseMirror pre {
  font-family: var(--font-mono);
  font-size: var(--t-code);
  line-height: var(--t-code-lh);
  background: var(--control-bg);
  border: var(--control-border);
  border-radius: var(--r-xl);
  padding: 10px 12px;
  margin: 0;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.ProseMirror pre code {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
  border-radius: 0;
}

.ProseMirror a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ProseMirror mark {
  background: var(--orange-200);
  color: var(--orange-800);
  border-radius: 2px;
  padding: 0 2px;
}

.ProseMirror img {
  max-width: 100%;
  border-radius: var(--r-xl);
  display: block;
}

/* 空文档占位 */
.ProseMirror p.is-empty:first-child::before,
.ProseMirror .is-empty::before {
  content: attr(data-placeholder);
  float: left;
  height: 0;
  pointer-events: none;
  color: var(--text-tertiary);
}

/* 光标 */
.ProseMirror-gapcursor:after {
  border-top: 1px solid var(--text-primary);
}

/* 语法高亮（严格对齐原型 .ui-code L321-326） */
.tok-kw    { color: var(--syn-kw); }
.tok-fn    { color: var(--syn-fn); }
.tok-str   { color: var(--syn-str); }
.tok-num   { color: var(--syn-num); }
.tok-com   { color: var(--syn-com); font-style: italic; }
.tok-punct { color: var(--syn-punct); }

/* ============================================================================
   任务列表 —— 6 种状态
   ========================================================================= */

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

.task-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: 3px 0;
  position: relative;
  font-size: var(--t-body);
  line-height: var(--t-body-lh);
}

.task-item__check {
  width: 14px;
  height: 14px;
  margin-top: 3.5px;
  border-radius: 4px;
  border: 1.5px solid var(--border-strong);
  background: transparent;
  flex: 0 0 auto;
  cursor: default;
  padding: 0;
  position: relative;
  transition: background var(--dur-hover), border-color var(--dur-hover);
}

.task-item__check:hover { border-color: var(--accent); }

.task-item__body { flex: 1; min-width: 0; }
.task-item__body > p { margin: 0; }

.task-item__status {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 2px 8px;
  border-radius: 999px;
  flex: 0 0 auto;
  margin-top: 2px;
  cursor: default;
  border: none;
  font-family: inherit;
  white-space: nowrap;
}

/* 状态配色（严格对齐原型 .ui-st.* L331-335 & L516-517） */
.st-backlog    { background: var(--ink-100);    color: var(--ink-600); }
.st-todo       { background: var(--blue-50);    color: var(--accent); }
.st-inProgress { background: var(--blue-100);   color: var(--accent); }
.st-inReview   { background: var(--orange-100); color: var(--orange-800); }
.st-done       { background: var(--green-100);  color: var(--green-800); }
.st-cancelled  { background: var(--ink-100);    color: var(--text-tertiary); text-decoration: line-through; }

/* 完成态 */
.task-item[data-status="done"] .task-item__body,
.task-item[data-status="cancelled"] .task-item__body {
  opacity: .55;
}
.task-item[data-status="cancelled"] .task-item__body { text-decoration: line-through; }

.task-item[data-status="done"] .task-item__check {
  background: var(--task-check-done-bg);
  border-color: var(--task-check-done-bg);
}
.task-item[data-status="done"] .task-item__check::after {
  content: "";
  position: absolute;
  left: 3.8px;
  top: 1.2px;
  width: 4.5px;
  height: 7px;
  border: solid #fff;
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(45deg);
}

/* ============================================================================
   浮层菜单（斜杠菜单 / 下拉）
   注意：浮层必须保持不透明，不跟随面板透明度
   ========================================================================= */

.menu {
  position: fixed;
  min-width: 186px;
  background: var(--popover-bg);
  border: var(--popover-border);
  backdrop-filter: var(--popover-backdrop);
  -webkit-backdrop-filter: var(--popover-backdrop);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-popover);
  overflow: hidden;
  z-index: 100;
  padding: 4px 0;
}

.menu__title {
  padding: 6px 12px 4px;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

.menu__item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 12px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 11.5px;
  color: var(--text-secondary);
  text-align: left;
  cursor: default;
}

.menu__item:hover,
.menu__item--active {
  background: var(--accent-subtle);
  color: var(--accent);
}

.menu__item--active { font-weight: 650; }

.menu__icon {
  width: 14px;
  display: flex;
  justify-content: center;
  color: var(--text-tertiary);
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 800;
}

.menu__item:hover .menu__icon,
.menu__item--active .menu__icon { color: var(--accent); }

.menu__key {
  margin-left: auto;
  font-size: 9.5px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.menu__sep { height: 1px; background: var(--border-subtle); margin: 3px 0; }
.menu__danger:hover { background: var(--danger-soft); color: var(--danger); }
.menu__danger:hover .menu__icon { color: var(--danger); }

/* ---------- 斜杠菜单（带过滤） ---------- */
.slash-menu {
  width: 268px;
  max-height: 292px;
  overflow-y: auto;
  padding: 4px 0;
}

.slash-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 12px;
  border: none;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: default;
  color: var(--text-secondary);
}

.slash-menu__item:hover,
.slash-menu__item--active { background: var(--blue-50); }

.slash-menu__glyph {
  width: 26px;
  height: 26px;
  border-radius: var(--r-md);
  background: var(--control-bg);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
}

.slash-menu__item--active .slash-menu__glyph {
  background: var(--accent-subtle);
  color: var(--accent);
}

.slash-menu__text { min-width: 0; }
.slash-menu__name {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-primary);
  line-height: 1.3;
}
.slash-menu__item--active .slash-menu__name { color: var(--accent); }
.slash-menu__desc {
  font-size: 10.5px;
  color: var(--text-tertiary);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slash-menu__empty {
  padding: 14px 12px;
  font-size: 11.5px;
  color: var(--text-tertiary);
  text-align: center;
}

/* ============================================================================
   状态栏（底部提示）
   ========================================================================= */

.statusbar {
  display: flex;
  align-items: center;
  height: 22px;
  padding: 0 var(--sp-5);
  flex: 0 0 auto;
  border-top: 1px solid var(--bar-border);
  font-size: 10.5px;
  color: var(--text-tertiary);
}

.statusbar__saved { margin-left: auto; }
.statusbar__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green-500);
  display: inline-block;
  margin-right: 5px;
  vertical-align: 1px;
}
.statusbar__dot--saving { background: var(--orange-500); }

/* ============================================================================
   窄面板适配：工具栏溢出时优先保留段落选择器与 B/I/U/代码
   ========================================================================= */

@media (max-width: 400px) {
  .toolbar__btn--optional { display: none; }
}

/* ============================================================================
   工具栏下拉与菜单内的紧凑控件
   ========================================================================= */

.toolbar__caret {
  font-size: 8px;
  opacity: .55;
  margin-left: 1px;
}

.menu__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 2px 12px 8px;
}

.menu__chip {
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 650;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  cursor: default;
  white-space: nowrap;
}

.menu__chip:hover { background: var(--blue-50); border-color: var(--accent-border); color: var(--accent); }
.menu__chip--on { background: var(--blue-100); border-color: var(--accent-border); color: var(--accent); }

.menu__swatches {
  display: flex;
  gap: 7px;
  padding: 4px 12px 10px;
}

.menu__swatch {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: var(--control-border);
  cursor: default;
  padding: 0;
}

.menu__swatch:hover { outline: 2px solid var(--accent-border); outline-offset: 1px; }

.menu__emoji {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 4px 8px 8px;
}

.menu__emoji-item {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  font-size: 15px;
  line-height: 1;
  cursor: default;
  padding: 0;
}

.menu__emoji-item:hover { background: var(--hover-bg); }

.menu__item[disabled] { opacity: .45; }

/* ============================================================================
   面板宽度拖动条 (左边缘 6px)
   ========================================================================= */

.panel-resizer {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
  z-index: 100;
  pointer-events: auto;
  background: transparent;
  transition: background var(--dur-hover);
}

.panel-resizer::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 42px;
  border-radius: 1.5px;
  background: var(--border-strong);
  opacity: 0;
  transition: opacity var(--dur-hover), background var(--dur-hover);
}

.panel-resizer:hover::after,
body.is-resizing .panel-resizer::after {
  opacity: 0.8;
  background: var(--accent);
}

body.is-resizing {
  cursor: ew-resize !important;
  user-select: none !important;
}

body.is-resizing .ifp-shell {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* ============================================================================
   全部笔记列表与抽屉
   ========================================================================= */

.notelist {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  background: transparent;
}

.notelist__search-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 6px 12px 6px;
  padding: 7px 11px;
  border: var(--control-border);
  border-radius: 10px;
  background: var(--control-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  font-size: 12.5px;
  color: var(--text-primary);
  transition: all var(--dur-hover) var(--ease-out);
}

.notelist__search-wrap:hover:not(:focus-within) {
  background: var(--control-bg-hover);
  border-color: var(--control-border-color-hover);
}

.notelist__search-wrap:focus-within {
  background: var(--control-bg-focus);
  border-color: rgba(92, 163, 255, 0.65);
  box-shadow: 0 0 0 2.5px rgba(92, 163, 255, 0.20);
}
.notelist__search-icon {
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  transition: color var(--dur-hover);
}

.notelist__search-icon svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 1.8;
}

.notelist__search-wrap:focus-within .notelist__search-icon {
  color: var(--accent);
}

.notelist__search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text-primary);
  outline: none;
  padding: 0;
  min-width: 0;
}

.notelist__search-input::placeholder {
  color: var(--text-tertiary);
}

.notelist__search-clear {
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: default;
  padding: 2px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
}

.notelist__search-clear:hover {
  color: var(--text-secondary);
  background: var(--border-subtle);
}

.notelist__filters {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 6px;
  border-bottom: none;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.notelist__filters::-webkit-scrollbar {
  display: none;
}

.notelist__chip {
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
  border: var(--control-border);
  background: var(--control-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--text-secondary);
  cursor: default;
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all var(--dur-hover) var(--ease-out);
}

.notelist__chip:hover {
  background: var(--control-bg-hover);
  border-color: var(--control-border-color-hover);
  color: var(--text-primary);
}

.notelist__chip--active {
  background: rgba(92, 163, 255, 0.12) !important;
  border-color: rgba(92, 163, 255, 0.28) !important;
  color: var(--accent) !important;
  font-weight: 600;
}
.notelist__chip--add {
  border: none !important;
  color: var(--text-tertiary);
  padding: 2px 7px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  background: transparent;
  cursor: pointer;
}
.notelist__chip--add:hover {
  border: none !important;
  color: var(--accent);
  background: var(--hover-bg);
}

.notelist__chip--input {
  min-width: 60px;
  max-width: 120px;
  border: 1px solid var(--accent) !important;
  background: var(--control-bg-focus) !important;
  color: var(--text-primary) !important;
  outline: none !important;
  box-shadow: 0 0 0 2px var(--accent-subtle);
  padding: 2.5px 8.5px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  cursor: text !important;
}

.notelist__chip.is-dragging {
  opacity: 0.35;
  transform: scale(0.96);
}

.notelist__chip.is-drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-subtle);
  transform: scale(1.05);
}

.notelist__folder-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--accent);
  background: var(--accent-subtle);
  padding: 1px 5px;
  border-radius: 4px;
  margin-right: 4px;
}

.notelist__folder-picker {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 130px;
  background: var(--popover-bg);
  border: var(--popover-border);
  backdrop-filter: var(--popover-backdrop);
  -webkit-backdrop-filter: var(--popover-backdrop);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-popover);
  z-index: 1000;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notelist__folder-picker-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 11px;
  color: var(--text-primary);
  background: transparent;
  border: none;
  cursor: default;
  text-align: left;
  width: 100%;
}
.notelist__folder-picker-item:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}

.notelist__items {
  flex: 1;
  overflow-y: auto;
  padding: 6px 12px 28px;
  transform: translateZ(0);
  contain: content;
}
.notelist__item {
  padding: 10px 12px;
  border-radius: 11px;
  position: relative;
  cursor: default;
  background: var(--card-bg);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  margin-bottom: 7px;
  transition: transform 120ms var(--ease-out),
              border-color 120ms var(--ease-out),
              box-shadow 120ms var(--ease-out);
}

.notelist__item + .notelist__item {
  margin-top: 0;
}

.notelist__item + .notelist__item::before {
  display: none;
}

.notelist__item:hover {
  background: var(--card-bg-hover);
  border-color: var(--card-border-color-hover);
  box-shadow: 0 3px 8px rgba(0, 0, 0, calc(0.03 + 0.04 * var(--panel-opacity))), var(--card-shadow);
  transform: translateY(-1px);
}

.notelist__item--active {
  background: var(--card-bg-active) !important;
  border-color: var(--card-border-color-active) !important;
  box-shadow: none !important;
}

.notelist__top-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
  position: relative;
  padding-right: 50px;
}

.notelist__kind {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  opacity: 0.88;
}

.notelist__kind--quick { color: var(--accent); }
.notelist__kind--todo  { color: var(--secondary); }
.notelist__kind--note  { color: var(--text-tertiary); }

.notelist__title {
  font-size: 13px;
  font-weight: 550;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.notelist__time {
  font-size: 10.5px;
  color: var(--text-tertiary);
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  pointer-events: none;
  opacity: 1;
  transition: opacity 140ms ease-out;
}

.notelist__snippet {
  font-size: 12px;
  line-height: 1.52;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-left: 21px;
}

/* 当卡片前置分类图标关闭时，消除正文摘要、标签与检索归因行的左侧 21px 缩进，彻底清除空白占位 */
.notelist__item--no-kind .notelist__snippet,
.notelist__item--no-kind .notelist__chips,
.notelist__item--no-kind .notelist__why,
.notelist--no-kind .notelist__snippet,
.notelist--no-kind .notelist__chips,
.notelist--no-kind .notelist__why {
  padding-left: 0 !important;
}

.notelist__item-acts {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease-out;
}

.notelist__item:hover .notelist__time {
  opacity: 0;
  pointer-events: none;
}

.notelist__item:hover .notelist__item-acts {
  opacity: 1;
  pointer-events: auto;
}

.notelist__act-btn {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  padding: 0;
  transition: all 120ms ease;
}

.notelist__act-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.notelist__act-btn--danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.notelist__act-btn--pinned {
  color: var(--accent) !important;
}

.notelist__act-btn--pinned:hover {
  background: rgba(92, 163, 255, 0.12) !important;
  color: var(--accent) !important;
}

.notelist__pin-badge {
  font-size: 9.5px;
  font-weight: 550;
  color: var(--accent);
  background: rgba(92, 163, 255, 0.10);
  border: 1px solid rgba(92, 163, 255, 0.22);
  padding: 1px 4.5px;
  border-radius: var(--r-xs);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}

.notelist__item--pinned {
  background: var(--card-bg-pinned);
  border: var(--card-border-pinned);
}

.notelist__item--pinned:hover {
  background: var(--card-bg-hover);
}

.notelist__empty {
  padding: 36px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ---------- 标签 Chips (原型图 01) ---------- */
.notelist__chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding-left: 21px;
  margin-top: 5px;
}

.notelist__chip-tag {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: all var(--dur-hover);
  border: 1px solid transparent;
}

.notelist__chip-tag:hover {
  opacity: 0.85;
}

.notelist__chip-tag--b {
  background: rgba(92, 163, 255, 0.12);
  color: var(--accent);
  border-color: rgba(92, 163, 255, 0.16);
}
.notelist__chip-tag--g {
  background: rgba(105, 207, 61, 0.12);
  color: var(--success);
  border-color: rgba(105, 207, 61, 0.16);
}
.notelist__chip-tag--w {
  background: rgba(255, 165, 31, 0.12);
  color: var(--warn);
  border-color: rgba(255, 165, 31, 0.16);
}
.notelist__chip-tag--p {
  background: var(--hover-bg);
  color: var(--text-secondary);
  border-color: var(--card-border-color);
}

/* ---------- 检索元信息与最佳匹配 (原型图 03) ---------- */
.notelist__meta {
  padding: 10px 15px 3px;
  font-size: 11px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border-bottom: none;
}

.notelist__pin {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: var(--good);
  background: var(--good-soft);
  border: none;
  padding: 2px 8px;
  border-radius: 999px;
}

.notelist__item--best {
  background: var(--card-bg-pinned) !important;
  border-color: var(--card-border-color-pinned) !important;
}

.notelist__score {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(92, 163, 255, 0.12);
  border: 1px solid rgba(92, 163, 255, 0.20);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: auto;
  font-family: var(--font-mono);
  flex: 0 0 auto;
}

.notelist__why {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: 5px;
  padding-left: 21px;
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.notelist__why-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 5px;
  flex: 0 0 auto;
}

.search-highlight {
  background: var(--orange-100);
  color: var(--secondary);
  border-radius: 2px;
  padding: 0 1px;
}

/* ---------- 搜索框命令列表项 (由搜索框输入 / 或点击 Logo 调起) ---------- */
.cmd-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  margin: 1.5px 0;
  border-radius: var(--r-md);
  font-size: 12.5px;
  color: var(--text-primary);
  cursor: default;
  transition: background var(--dur-hover) var(--ease-out), color var(--dur-hover) var(--ease-out);
}

.cmd-row:hover,
.cmd-row--active {
  background: var(--accent-subtle) !important;
  color: var(--accent) !important;
  font-weight: 600;
  border-radius: var(--r-md);
}

.cmd-row .ic {
  width: 15px;
  display: flex;
  justify-content: center;
  color: var(--text-tertiary);
  flex: 0 0 auto;
}

.cmd-row:hover .ic,
.cmd-row--active .ic {
  color: var(--accent) !important;
}

.cmd-row .cmd-title,
.cmd-row span:not(.ic):not(.kk):not(.cmd-trigger) {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-row .cmd-trigger {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: rgba(140, 150, 170, 0.12);
  padding: 1.5px 6px;
  border-radius: 4px;
  flex: 0 0 auto;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.cmd-row .kk {
  font-size: 10px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  background: rgba(140, 150, 170, 0.08);
  padding: 1.5px 5px;
  border-radius: 4px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.cmd-row .cmd-trigger + .kk {
  margin-left: -2px;
}

.cmd-row:hover .cmd-trigger,
.cmd-row--active .cmd-trigger,
.cmd-row:hover .kk,
.cmd-row--active .kk {
  color: var(--accent) !important;
  background: rgba(14, 165, 233, 0.18) !important;
}

/* ============================================================================
   偏好设置视图 (方案 A: macOS 原生分组卡片流)
   ========================================================================= */

.settings-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: transparent;
  padding: 14px 14px 56px;
  user-select: none;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(140, 150, 170, 0.28) transparent !important;
}
.settings-view::-webkit-scrollbar {
  display: block !important;
  width: 5px !important;
}
.settings-view::-webkit-scrollbar-thumb {
  background: rgba(140, 150, 170, 0.25);
  border-radius: 4px;
}
.settings-view::-webkit-scrollbar-thumb:hover {
  background: rgba(140, 150, 170, 0.45);
}

.section-label {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 12px 6px 6px;
}
.section-label:first-child { margin-top: 2px; }

.settings-group {
  flex-shrink: 0;
  background: var(--card-bg);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--text-primary);
  min-height: 42px;
  border-bottom: 1px solid var(--bar-border);
  transition: background var(--dur-hover) var(--ease-out);
  box-sizing: border-box;
  width: 100%;
}
.settings-row:hover {
  background: var(--card-bg-hover);
}
.settings-row:last-child { border-bottom: none; }

.settings-row > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.settings-row__desc {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
  line-height: 1.35;
  word-break: break-word;
}

/* 切换开关 Switch */
.toggle {
  position: relative;
  width: 36px;
  height: 20px;
  display: inline-block;
  flex: 0 0 auto;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border);
  border-radius: 20px;
  transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.toggle input:checked + .toggle-slider { background-color: var(--accent); }
.toggle input:checked + .toggle-slider:before { transform: translateX(16px); }

/* 分段选择器 Segmented Control */
.segmented {
  display: flex;
  background: var(--control-bg);
  border: var(--control-border);
  padding: 2px;
  border-radius: 8px;
  gap: 2px;
  flex: 0 0 auto;
}
.segmented__item {
  border: none;
  background: transparent;
  font-size: 11px;
  color: var(--text-secondary);
  padding: 3px 7px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.segmented__item:hover {
  color: var(--text-primary);
}
.segmented__item--active {
  background: var(--card-bg-hover) !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
  font-weight: 600;
}

/* 菜单栏图标选择器 */
.icon-picker {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.icon-picker__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 44px;
  padding: 4px 2px;
  border: var(--control-border);
  border-radius: 7px;
  background: var(--control-bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--dur-hover) var(--ease-out);
}

.icon-picker__item:hover {
  background: var(--control-bg-hover);
  border-color: var(--accent-border);
  color: var(--accent);
}

.icon-picker__item--active {
  background: var(--accent-subtle) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  box-shadow: none !important;
  font-weight: 600;
}

.icon-picker__preview {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-picker__preview svg {
  width: 14px;
  height: 14px;
  display: block;
}

.icon-picker__label {
  font-size: 9px;
  line-height: 1.2;
  white-space: nowrap;
}

/* 快捷键键帽 Keycap */
.keycap {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--control-bg);
  border: var(--control-border);
  border-radius: 5px;
  padding: 2px 7px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* 滑块与数值标注 */
.slider-box {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 146px;
  max-width: 46%;
  flex: 0 0 auto;
}
.slider-box input[type="range"] {
  flex: 1;
  min-width: 48px;
  height: 4px;
  accent-color: var(--accent);
  cursor: pointer;
}
.slider-val {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  width: 44px;
  text-align: right;
  flex: 0 0 auto;
}

@media (max-width: 400px) {
  .settings-view {
    padding: 10px 10px 56px;
  }
  .settings-row {
    padding: 9px 10px;
    gap: 8px;
  }
  .slider-box {
    width: 120px;
  }
  .icon-picker {
    gap: 3px;
  }
  .icon-picker__item {
    width: 38px;
    padding: 3px 1px;
  }
  .icon-picker__label {
    display: none;
  }
  .segmented__item {
    padding: 3px 5px;
    font-size: 10.5px;
  }
}

/* 按钮小控件 */
.settings-btn {
  border: var(--control-border);
  background: var(--control-bg);
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background var(--dur-hover), color var(--dur-hover), border-color var(--dur-hover);
}
.settings-btn:hover {
  background: var(--control-bg-hover);
  color: var(--text-primary);
  border-color: var(--control-border-color-hover);
}
.settings-btn--accent {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-subtle);
}
.settings-btn--danger {
  color: var(--danger);
  border-color: var(--danger-soft);
  background: var(--danger-soft);
}
.settings-btn--danger:hover {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

