/* ============================================================
   随行档 · 应用内壳（飞书风格重构）
   冷白画布 + 飞书蓝 #3370FF + 标志青 #00D6B9 + 256px 文字侧栏
   ============================================================ */
/* 设计 token 见 tokens.css（四端单一真源：#3370FF + Geist + Arco 语义色 + 统一灰阶/边框/投影/圆角）*/

* { margin: 0; padding: 0; box-sizing: border-box; }

html { overflow-x: hidden; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---- Layout · 飞书式 256px 文字侧栏 ---- */
.app-layout { display: flex; height: 100vh; height: 100dvh; overflow: hidden; position: relative; }
/* 应用壳视图锁 body（app.js 在 renderLayout 时给 body 加 view-shell；落地页/登录页不加） */
body.view-shell { overflow: hidden; background: var(--bg-surface); }

/* 打印兜底：解锁 body 与所有滚动/裁剪容器，避免应用壳只能打印第一页 */
@media print {
  html, body { overflow: visible !important; height: auto !important; }
  body.view-shell { overflow: visible !important; }
  .app-layout, .main-content, .chat-container, .settings-layout { display: block !important; height: auto !important; overflow: visible !important; }
  .sidebar, .settings-nav, .settings-topbar, .settings-scrim, .sidebar-collapse { display: none !important; }
  .files-body, .chat-messages, .settings-panel, .note-editor-split, .note-preview-pane, .note-toc-list { overflow: visible !important; height: auto !important; }
}

.sidebar {
  width: 256px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0; overflow: visible; /* 折叠态 tooltip 需越出侧栏右缘；各文本行自带 ellipsis，展开过渡不溢出 */
  transition: width .2s ease;
}

/* 折叠态：缩为 64px 纯图标（快捷操作入口保留为图标按钮，不丢 ⌘K 视觉入口） */
.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .workspace-name,
.sidebar.collapsed .nav-item-label,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .sidebar-user-info { display: none; }
.sidebar.collapsed .workspace { padding: 0; justify-content: center; }
.sidebar.collapsed .workspace-avatar { margin: 0 auto; }
.sidebar.collapsed .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar.collapsed .sidebar-footer { padding: 12px 0; }
.sidebar.collapsed .sidebar-user { justify-content: center; }
.sidebar.collapsed .sidebar-search { padding: 0 12px 12px; }
.sidebar.collapsed .sidebar-search-box { justify-content: center; padding: 8px 0; }
.sidebar.collapsed .sidebar-search-box svg { width: 17px; height: 17px; }
.sidebar.collapsed .sidebar-search-box span,
.sidebar.collapsed .sidebar-search-box kbd { display: none; }
/* 折叠态回收站角标缩为小红点（数字移到 tooltip 语义之外，仅示"有"） */
.sidebar.collapsed .nav-badge:not([hidden]) {
  position: absolute; top: 5px; right: 9px; min-width: 7px; width: 7px; height: 7px;
  padding: 0; border-radius: 50%; font-size: 0; line-height: 0;
}
/* 设计系统 tooltip：仅折叠态启用（展开态已有文字，避免重复）。hover 与键盘 focus 均可触发 */
.sidebar.collapsed [data-tip] { position: relative; }
.sidebar.collapsed [data-tip]::after {
  content: attr(data-tip);
  position: absolute; left: calc(100% + 10px); top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: var(--ink); color: var(--bg-surface);
  font-size: 12px; font-weight: 500; line-height: 1;
  padding: 6px 9px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow); white-space: nowrap;
  opacity: 0; pointer-events: none; z-index: 1000;
  transition: opacity .12s ease, transform .12s ease;
}
.sidebar.collapsed [data-tip]:hover::after,
.sidebar.collapsed [data-tip]:focus-visible::after {
  opacity: 1; transform: translateY(-50%) translateX(0);
}

/* 移动端（≤768）：侧栏自动收为图标栏，复用折叠态视觉，避免挤占内容区（纯 CSS，无 JS / 新增元素，不影响桌面）*/
@media (max-width: 768px) {
  .sidebar { width: 64px; }
  .sidebar .workspace-name,
  .sidebar .nav-item-label,
  .sidebar .nav-section-label,
  .sidebar .sidebar-user-info { display: none; }
  .sidebar .workspace { padding: 0; justify-content: center; }
  .sidebar .workspace-avatar { margin: 0 auto; }
  .sidebar .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }
  .sidebar .sidebar-footer { padding: 12px 0; }
  .sidebar .sidebar-user { justify-content: center; }
  .sidebar .sidebar-search { padding: 0 12px 12px; }
  .sidebar .sidebar-search-box { justify-content: center; padding: 8px 0; }
  .sidebar .sidebar-search-box svg { width: 17px; height: 17px; }
  .sidebar .sidebar-search-box span,
  .sidebar .sidebar-search-box kbd { display: none; }
  .sidebar .nav-badge:not([hidden]) {
    position: absolute; top: 5px; right: 9px; min-width: 7px; width: 7px; height: 7px;
    padding: 0; border-radius: 50%; font-size: 0; line-height: 0;
  }
  .sidebar-collapse { display: none; }   /* 窄屏无需手动折叠开关 */
}

/* —— 工作区头部 —— */
.sidebar-header {
  padding: 16px 16px 12px; flex-shrink: 0;
}
.workspace {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 0; cursor: pointer; border-radius: var(--radius);
  transition: opacity .15s;
}
.workspace:hover { opacity: 0.85; }
.workspace-avatar {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sans); font-size: 16px; font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, #5B8DEF 100%);
  box-shadow: var(--shadow-xs);
}
.workspace-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.workspace-title {
  font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.workspace-sub {
  font-size: 11.5px; color: var(--text-muted); white-space: nowrap;
}

/* —— 快捷操作入口 —— */
.sidebar-search {
  padding: 0 12px 12px; flex-shrink: 0;
}
.sidebar-search-box {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  background: var(--bg-surface-hover); cursor: pointer;
  transition: background .15s;
}
.sidebar-search-box:hover { background: var(--bg-surface-active); }
.sidebar-search-box:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.sidebar-search-box svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.sidebar-search-box span { font-size: 13px; color: var(--text-muted); }
.sidebar-search-box kbd {
  margin-left: auto; font-family: var(--font-mono); font-size: 10.5px;
  padding: 1px 5px; border-radius: 3px; background: var(--bg-surface);
  color: var(--text-muted); border: 1px solid var(--border);
}

/* —— 导航区 —— */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 12px; }

.nav-section { margin-bottom: 4px; }
.nav-section-label {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 12px 10px 4px;
}

.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin: 1px 0; border-radius: var(--radius-sm);
  border: none; background: transparent; color: var(--text-secondary);
  cursor: pointer; font-family: inherit; font-size: 13.5px; font-weight: 500;
  width: 100%; text-align: left;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--bg-surface-hover); color: var(--text); }
.nav-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  padding: 0px 6px; border-radius: 10px; min-width: 18px; text-align: center;
  background: var(--danger); color: #fff;
}

.nav-spacer { flex: 1; }

/* —— 侧栏底部用户区 —— */
.sidebar-footer { padding: 12px; flex-shrink: 0; border-top: 1px solid var(--border-light); }
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer;
  transition: background .15s;
}
.sidebar-user:hover { background: var(--bg-surface-hover); }
.sidebar-user-avatar {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, #5B8DEF 100%);
}
.sidebar-user-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sidebar-user-name { font-size: 13px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-sub { font-size: 11px; color: var(--text-muted); }
.sidebar-user .nav-item { padding: 6px; width: auto; }

.nav-logout {
  color: var(--text-muted);
}
.nav-logout:hover { background: var(--danger-light); color: var(--danger); }

/* -- 账户弹层（侧栏左下角点击展开） -- */
.account-popover {
  position: fixed; z-index: 1000; width: 280px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 6px; animation: ap-in .12s ease-out;
}
@keyframes ap-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ap-header { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; }
.ap-avatar {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, #5B8DEF 100%);
}
.ap-meta { min-width: 0; flex: 1; }
.ap-name { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.ap-storage { padding: 8px 8px 6px; border-top: 1px solid var(--border-light); font-size: 12px; color: var(--text-muted); }
.ap-storage-head { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--text); }
.ap-storage-track { height: 6px; background: var(--bg-surface-hover); border-radius: 3px; overflow: hidden; }
.ap-storage-bar { height: 100%; border-radius: 3px; transition: width .3s; }
.ap-storage-bar.fill-success { background: var(--success); }
.ap-storage-bar.fill-warning { background: var(--warning); }
.ap-storage-bar.fill-danger { background: var(--danger); }
.ap-storage-foot { margin-top: 4px; font-size: 11px; }
.ap-storage-note { padding: 2px 0; }
.ap-fail { color: var(--danger); }
.ap-login { padding: 6px 8px; border-top: 1px solid var(--border-light); font-size: 12px; display: flex; justify-content: space-between; gap: 8px; }
.ap-login-label { color: var(--text-muted); flex-shrink: 0; }
.ap-login-val { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-menu { padding: 4px 0 0; border-top: 1px solid var(--border-light); margin-top: 2px; }
.ap-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: none; background: none; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text); cursor: pointer; text-align: left;
}
.ap-item:hover { background: var(--bg-surface-hover); }
.ap-item svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.ap-divider { height: 1px; background: var(--border-light); margin: 4px 0; }
.ap-danger { color: var(--danger); }
.ap-danger svg { color: var(--danger); }
.ap-danger:hover { background: var(--danger-light); }

/* 折叠按钮：骑在侧栏右缘边框上（展开/收起均可见）。
   历史 bug 修复：旧实现 absolute 无定位祖先，按钮被钉死在视口右下角半枚出屏，
   用户根本找不到折叠入口。现挂到 .app-layout（position:relative），left 随侧栏宽度同步过渡。 */
.sidebar-collapse {
  position: absolute; bottom: 16px; left: 244px; z-index: 30;
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--shadow-sm);
  color: var(--text-muted);
  transition: left .2s ease, background .15s, color .15s, border-color .15s;
}
.sidebar-collapse:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.sidebar-collapse:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sidebar-collapse svg { width: 14px; height: 14px; transition: transform .2s; }
.app-layout.sidebar-collapsed .sidebar-collapse { left: 52px; }
.app-layout.sidebar-collapsed .sidebar-collapse svg { transform: rotate(180deg); }
/* 首次使用引导：呼吸光圈提示此处可折叠，点过一次即止（pref sidebarHintSeen） */
.sidebar-collapse.pulse-once { animation: sidebar-collapse-pulse 1.8s ease-in-out 4; }
@keyframes sidebar-collapse-pulse {
  0%, 100% { box-shadow: var(--shadow-sm), 0 0 0 0 rgba(51, 112, 255, 0.45); }
  50% { box-shadow: var(--shadow-sm), 0 0 0 8px rgba(51, 112, 255, 0); }
}

.main-content { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }

/* ---- Topbar · 飞书式页面头 ---- */
.topbar {
  height: auto; min-height: 52px; padding: 8px 24px; gap: 12px; flex-shrink: 0;
  display: flex; align-items: center; flex-wrap: wrap;
  background: var(--bg-surface); border-bottom: 1px solid var(--border);
}
.topbar-title {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans); font-size: 16px; font-weight: 600;
  letter-spacing: -0.011em; white-space: nowrap; flex-shrink: 0; color: var(--text);
}
.topbar-title svg { width: 18px; height: 18px; flex-shrink: 0; }
.topbar-subtitle { font-size: 12px; color: var(--text-muted); margin-left: 8px; }
.topbar-spacer { flex: 1; }

/* ---- Login 样式已抽到 auth.css（用户端 + 管理端共用）---- */

/* ---- Forms (shared) ---- */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 13px; color: var(--text-secondary);
  margin-bottom: 6px; font-weight: 500;
}
.form-input {
  width: 100%; padding: 11px 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.form-input::placeholder { color: var(--text-muted); }
.form-input.error, .form-input.error:focus { border-color: var(--danger); }
.input-error-msg { font-size: 12px; color: var(--danger); margin-top: 6px; min-height: 16px; }

/* ---- Buttons ---- */
.btn {
  padding: 7px 14px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: 13px; font-weight: 500; font-family: inherit; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap; flex-shrink: 0;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; font-weight: 500; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-sm); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: var(--bg-surface); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--primary); background: var(--primary-lighter); color: var(--primary); }
.btn-danger { background: var(--danger-light); color: var(--danger); }
.btn-danger:hover { background: rgba(245, 63, 63, 0.12); }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg-surface-hover); }
.btn-icon-only { padding: 7px; width: 32px; height: 32px; }
/* 停止生成 */
.btn-primary.is-stop { background: var(--bg-elevated); color: var(--text); border-color: var(--border); }
.btn-primary.is-stop:hover { background: var(--bg-surface-hover); border-color: var(--border-strong); }
.btn-primary.is-stop svg { width: 14px; height: 14px; }

/* ---- File Browser ---- */
.files-header {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 24px; background: var(--bg-surface);
  border-bottom: 1px solid var(--border); flex-shrink: 0; flex-wrap: wrap;
}
.files-title { display: flex; align-items: baseline; gap: 10px; flex-shrink: 0; }
.files-title h1 { font-family: var(--font-sans); font-size: 16px; font-weight: 600; letter-spacing: -0.011em; color: var(--text); margin: 0; }
.files-count { font-family: var(--font-sans); font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; min-height: 1em; }
.files-search { flex: 1; min-width: 200px; max-width: 440px; }
.files-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; margin-left: auto; }
.files-divider { width: 1px; height: 20px; background: var(--border); margin: 0 4px; flex-shrink: 0; }

/* —— 存储配额进度环（顶部右端）—— */
.quota-ring { flex-shrink: 0; width: 36px; height: 36px; position: relative; }
.quota-ring svg { width: 36px; height: 36px; transform: rotate(-90deg); }
.quota-ring .q-bg { fill: none; stroke: var(--border-light); stroke-width: 3; }
.quota-ring .q-fg { fill: none; stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset .4s ease, stroke .25s; }
.quota-ring .q-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 9px; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.quota-ring.is-warn .q-fg { stroke: var(--warning); }
.quota-ring.is-danger .q-fg { stroke: var(--danger); }
.quota-ring:not(.is-warn):not(.is-danger) .q-fg { stroke: var(--primary); }

.files-body { flex: 1; overflow-y: auto; padding: 18px 24px 24px; }

.search-box { flex: 1; position: relative; min-width: 0; }
/* 文件库页头搜索：保住最小宽，否则在窄内容区会被 flex 压到几像素；放不下时整条换行（与 .notes-search 行为对齐）*/
.files-search.search-box { flex: 1 1 200px; min-width: 200px; }
@media (max-width: 560px) { .files-search.search-box { flex-basis: 100%; max-width: none; } .files-controls { margin-left: 0; } }
.search-box input {
  width: 100%; padding: 8px 12px 8px 34px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 13px; font-family: inherit; transition: border-color .15s;
}
.search-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-muted); }

/* 面包屑 · 登记册路径 */
.breadcrumb { display: flex; align-items: center; gap: 2px; margin-bottom: 16px; font-size: 13px; flex-wrap: wrap; }
.breadcrumb-item {
  color: var(--text-secondary); cursor: pointer; padding: 4px 8px;
  border-radius: var(--radius-sm); transition: background .15s, color .15s; white-space: nowrap;
}
.breadcrumb-item:hover { background: var(--bg-surface-hover); color: var(--text); }
.breadcrumb-item.current { color: var(--text); font-weight: 500; }
.breadcrumb-item[aria-current="page"].current { color: var(--primary); }
.breadcrumb-sep { color: var(--text-muted); }
.breadcrumb-item svg { width: 14px; height: 14px; vertical-align: middle; }

/* 文件表 · 现代列表（淡分隔线 + 留白，飞书/Notion 式）
   列模板单一真源 --file-cols：表头与行共用同一变量，杜绝错位（R1）。
   操作列定宽 var(--file-actions-w)，保证表头占位与行内按钮同宽（R1）。
   状态色优先级（高→低）：is-selected > is-sensitive > is-pinned > hover */
.file-list-card { background: transparent; border: none; border-radius: 0; display: flex; flex-direction: column; }
.file-table {
  background: transparent; border: none; border-radius: 0;
  --file-cols: minmax(0, 1fr) minmax(72px, auto) minmax(80px, auto) minmax(96px, auto) var(--file-actions-w, 160px);
  display: flex; flex-direction: column;
}
.file-table-head,
.file-row {
  display: grid; align-items: center; gap: 12px;
  grid-template-columns: var(--file-cols);
}
.file-table-head {
  padding: 8px 20px;
  border-bottom: 1px solid var(--border);
}
.file-table-head .file-cell {
  font-family: var(--font-sans); font-size: 12px; font-weight: 500;
  color: var(--text-muted); text-transform: none; letter-spacing: 0;
}
/* 表头操作列保留占位（visibility:hidden 而非 display:none），与行同列宽（R1） */
.file-table-head .file-cell--actions { visibility: hidden; }
.file-row {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
  border-radius: 0;
  transition: background .12s; cursor: pointer;
}
.file-row:last-child { border-bottom: none; }
.file-row:hover { background: var(--bg-surface-hover); }
/* 置顶：统一品牌蓝（左条 + 浅蓝底），杜绝蓝橙打架（R3） */
.file-row.is-pinned { box-shadow: inset 3px 0 0 var(--primary); background: var(--primary-lighter); }   /* R3 契约：左条+品牌浅蓝底；与「选中」(primary-light+整边框) 可区分 */
.file-row.is-pinned:hover { background: var(--primary-light); }

.file-cell { min-width: 0; }
.file-cell--name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; }
.file-cell--type { font-family: var(--font-sans); font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.file-cell--size { font-family: var(--font-sans); font-size: 12px; color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }
.file-cell--date { font-family: var(--font-sans); font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* 操作列常驻可见（删除 opacity:0/hover 显隐冲突 R4） */
.file-cell--actions { display: flex; gap: 2px; justify-content: flex-end; }

.file-controls { display: flex; gap: 4px; flex-shrink: 0; }

/* 文件网格视图 */
.file-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px; background: transparent; border: none;
}
.file-card {
  position: relative; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .15s; text-align: center;
}
.file-card:hover { border-color: var(--primary); background: var(--bg-surface-hover); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.file-card.is-pinned { box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--primary-ring); }
.file-card .file-icon { width: 48px; height: 48px; margin: 0; }
.file-card .file-icon svg { width: 36px; height: 36px; }
.file-card .file-name {
  font-size: 13px; line-height: 1.4; width: 100%; flex: none;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  white-space: normal; text-overflow: ellipsis;
}
.file-card .file-card-meta { font-family: var(--font-sans); font-size: 11px; color: var(--text-muted); min-height: 1.4em; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.file-card .file-card-pin { position: absolute; top: 10px; right: 10px; color: var(--primary); }
.file-card .file-card-pin svg { width: 14px; height: 14px; }
/* —— 笔记视图卡片：加宽列宽（160px）并增加 meta 信息量 —— */
.file-grid.note-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }

/* 选中态 */
.file-row.is-selected, .file-card.is-selected { background: var(--primary-light); border-color: var(--primary); }
.file-row.is-selected:hover { background: var(--primary-light); }

/* 选择 checkbox（语义化 input，keyboard 可达） */
.file-check {
  width: 18px; height: 18px; border-radius: 5px;
  border: 2px solid var(--border-strong); background: var(--bg-surface);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  cursor: pointer; margin-right: 8px; transition: background .15s, border-color .15s;
  appearance: none; -webkit-appearance: none; color: transparent;
}
.file-check:hover { border-color: var(--primary); }
.file-check:focus-visible { outline: 2px solid var(--primary-ring); outline-offset: 1px; }
.file-check.is-checked { background: var(--primary); border-color: var(--primary); color: var(--bg-surface); }
.file-check.is-checked::after { content: ''; width: 11px; height: 11px; background: currentColor; clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%); }
.file-card .file-check { position: absolute; top: 8px; left: 8px; margin: 0; background: var(--bg-surface); }

/* 批量操作栏 */
.batch-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; margin-bottom: 14px;
  background: var(--primary-lighter); border: 1px solid var(--primary-ring);
  border-radius: var(--radius-lg); font-size: 13px; flex-wrap: wrap;
}
.batch-count { font-weight: 600; color: var(--primary); font-family: var(--font-sans); letter-spacing: 0.02em; }
.batch-count[aria-live="polite"] { min-width: 60px; }
.batch-spacer { flex: 1; }
.batch-bar .btn-sm { padding: 6px 12px; }

/* 旧 .file-row 兼容（无 file-cell 时由 flex 兜底） */
.file-row .file-icon { margin-right: 0; }

.file-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); background: var(--bg-sunken);
}
.file-icon svg { width: 22px; height: 22px; }
/* 徽章折叠 +N */
.badge-more { display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: var(--radius-sm); background: var(--bg-sunken); color: var(--text-secondary); cursor: help; }

/* 文件类型色 · 严格走 tokens.css --type-* 语义色 · 加浅色底更显眼 */
.file-icon.folder { color: var(--primary); background: var(--primary-lighter); }
.file-icon.type-pdf { color: var(--type-pdf); background: rgba(245, 63, 63, 0.08); }
.file-icon.type-doc { color: var(--type-doc); background: rgba(51, 112, 255, 0.08); }
.file-icon.type-xls { color: var(--type-xls); background: rgba(0, 180, 42, 0.08); }
.file-icon.type-ppt { color: var(--type-ppt); background: rgba(255, 125, 0, 0.08); }
.file-icon.type-md { color: var(--type-md); background: rgba(31, 35, 41, 0.06); }
.file-icon.type-img { color: var(--type-img); background: rgba(0, 180, 42, 0.08); }
.file-icon.type-video { color: var(--type-video); background: rgba(179, 127, 235, 0.10); }
.file-icon.type-audio { color: var(--type-audio); background: rgba(179, 127, 235, 0.10); }
.file-icon.type-archive { color: var(--type-archive); }
.file-icon.type-code { color: var(--type-code); }
.file-icon.type-text { color: var(--type-text); }
.file-icon.type-app { color: var(--type-app); }
.file-icon.type-design { color: var(--type-design); }
.file-icon.type-other { color: var(--type-other); }

/* 类型文本 badge（色觉无障碍：label 文本 + 浅色底） */
.type-badge {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  padding: 1px 6px; border-radius: var(--radius-sm);
  background: var(--bg-sunken); color: var(--text-muted);
  letter-spacing: 0.02em; white-space: nowrap;
}
.type-badge.type-pdf { color: var(--type-pdf); background: rgba(245, 63, 63, 0.08); }
.type-badge.type-doc { color: var(--type-doc); background: rgba(51, 112, 255, 0.08); }
.type-badge.type-xls { color: var(--type-xls); background: rgba(0, 180, 42, 0.08); }
.type-badge.type-ppt { color: var(--type-ppt); background: rgba(255, 125, 0, 0.08); }
.type-badge.type-md { color: var(--type-md); background: rgba(31, 35, 41, 0.06); }
.type-badge.type-img { color: var(--type-img); background: rgba(0, 180, 42, 0.08); }
.type-badge.type-video { color: var(--type-video); background: rgba(179, 127, 235, 0.10); }
.type-badge.type-audio { color: var(--type-audio); background: rgba(179, 127, 235, 0.10); }
.type-badge.type-archive { color: var(--type-archive); }
.type-badge.type-code { color: var(--type-code); }
.type-badge.type-text { color: var(--type-text); }
.type-badge.type-app { color: var(--type-app); }
.type-badge.type-design { color: var(--type-design); }
.type-badge.type-other { color: var(--type-other); }

/* 来源 badge */
.source-badge {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  padding: 1px 6px; border-radius: var(--radius-sm);
  background: var(--bg-sunken); color: var(--text-muted);
  white-space: nowrap;
}

.file-name { flex: 1; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-name-info { display: flex; flex-direction: column; gap: 1px; min-width: 120px; flex: 1; }
.file-name-info .file-name { flex: none; }
.file-snippet { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.4; }
.file-snippet mark.search-hit { background: rgba(255, 125, 0, 0.14); color: var(--warning); border-radius: 2px; padding: 0 1px; font-weight: 600; }
.file-row--snippet { grid-template-rows: auto; padding-top: 8px; padding-bottom: 8px; }

/* 操作列常驻（不再 hover 才显） */
.file-actions { display: flex; gap: 2px; justify-content: flex-end; opacity: 1; visibility: visible; }
.file-actions .icon-btn:focus-visible { outline: 2px solid var(--primary-ring); outline-offset: 1px; border-radius: var(--radius-sm); }

.icon-btn {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  border: none; background: transparent; color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s; flex-shrink: 0;
}
.icon-btn:hover { background: var(--bg-elevated); color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-light); }
.icon-btn svg { width: 16px; height: 16px; }

/* —— 空状态（三类：空库 / 空分组 / 空目录）—— */
.empty-state {
  padding: 64px 20px; text-align: center; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--text); }
.empty-desc { font-size: 13px; margin-top: 2px; color: var(--text-muted); }
.empty-card {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 60px 28px; text-align: center;
  background: var(--bg-surface); border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}
.empty-card .empty-illust {
  width: 60px; height: 60px; border-radius: var(--radius-pill);
  background: var(--primary-lighter); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.empty-card .empty-illust svg { width: 30px; height: 30px; }
.empty-card .empty-title { font-size: 16px; font-weight: 600; color: var(--text); }
.empty-card .empty-desc { font-size: 13px; color: var(--text-muted); margin: 0; max-width: 28em; }
.empty-card .empty-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.error-state { display: flex; flex-direction: column; align-items: center; gap: 4px; }

/* 骨架屏 */
.skeleton-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.skeleton-row:last-child { border-bottom: none; }
.sk-icon { width: 32px; height: 32px; border-radius: var(--radius-sm); flex-shrink: 0; background: var(--bg-elevated); }
.sk-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.sk-line {
  height: 10px; border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--border-light) 37%, var(--bg-elevated) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite;
}
.sk-line.w-50 { width: 50%; }
.sk-line.w-25 { width: 25%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---- Upload Zone (drag-drop) ---- */
.upload-overlay {
  position: fixed; inset: 0;
  background: rgba(51, 112, 255, 0.06); backdrop-filter: blur(4px);
  z-index: 998; display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.upload-overlay-box {
  border: 2px dashed var(--primary); border-radius: var(--radius-lg);
  padding: 60px 80px; text-align: center; background: var(--bg-surface);
}
.upload-overlay-box svg { width: 48px; height: 48px; color: var(--primary); margin-bottom: 12px; }
.upload-overlay-box p { font-size: 18px; font-weight: 600; color: var(--text); }

/* ---- Upload Progress ---- */
.upload-list {
  position: fixed; bottom: 20px; right: 20px; width: 320px;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); z-index: 1000; overflow: hidden;
}
.upload-list-header {
  padding: 12px 16px; font-size: 13px; font-weight: 600;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.upload-item { padding: 10px 16px; border-bottom: 1px solid var(--border); }
.upload-item:last-child { border-bottom: none; }
.upload-item-name { font-size: 13px; margin-bottom: 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.upload-item-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.upload-item-status { font-family: var(--font-mono); font-size: 12px; white-space: nowrap; flex-shrink: 0; }
.progress-bar { height: 3px; background: var(--bg); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 2px; transition: width .2s; }
.progress-fill.success { background: var(--success); }
.progress-fill.error { background: var(--danger); }

/* ---- Chat ---- */
.chat-container { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.chat-messages { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.chat-message { max-width: 80%; }
.chat-message.user { align-self: flex-end; }
.chat-message.assistant { align-self: flex-start; }
.chat-bubble {
  padding: 12px 16px; border-radius: var(--radius-lg);
  font-size: 14px; line-height: 1.6; word-break: break-word;
}
.chat-message.user .chat-bubble { background: var(--bg-sunken); color: var(--text); }
.chat-message.assistant .chat-bubble { background: var(--primary-bg); border: 1px solid var(--primary-bg); }
.chat-tools { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chat-tool-badge { font-family: var(--font-mono); font-size: 11px; padding: 2px 8px; border-radius: var(--radius-sm); background: var(--primary-light); color: var(--primary); }

/* Chat 空状态 · 欢迎卡 */
.chat-welcome { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; text-align: center; gap: 8px; }
.chat-welcome-icon { width: 56px; height: 56px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; background: var(--primary-light); color: var(--primary); margin-bottom: 8px; }
.chat-welcome-icon svg { width: 28px; height: 28px; }
.chat-welcome-title { font-size: 20px; font-weight: 600; letter-spacing: -0.018em; color: var(--text); }
.chat-welcome-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 18px; max-width: 28em; }
.chat-welcome-hints { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 460px; }
.chat-hint { font: inherit; font-size: 13.5px; cursor: pointer; padding: 8px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-secondary); transition: border-color .15s, color .15s; }
.chat-hint:hover { border-color: var(--primary); color: var(--primary); }

/* Chat Markdown 内容样式 */
.chat-message.assistant .chat-bubble p { margin: 0 0 8px; }
.chat-message.assistant .chat-bubble p:last-child { margin-bottom: 0; }
.chat-message.assistant .chat-bubble > *:first-child { margin-top: 0; }
.chat-message.assistant .chat-bubble > *:last-child { margin-bottom: 0; }
.chat-message.assistant .chat-bubble ul,
.chat-message.assistant .chat-bubble ol { margin: 6px 0 8px; padding-left: 22px; }
.chat-message.assistant .chat-bubble li { margin: 2px 0; }
.chat-message.assistant .chat-bubble li > ul,
.chat-message.assistant .chat-bubble li > ol { margin: 2px 0; }
.chat-message.assistant .chat-bubble h1,
.chat-message.assistant .chat-bubble h2,
.chat-message.assistant .chat-bubble h3,
.chat-message.assistant .chat-bubble h4 { margin: 12px 0 6px; line-height: 1.3; font-weight: 600; }
.chat-message.assistant .chat-bubble h1 { font-size: 18px; }
.chat-message.assistant .chat-bubble h2 { font-size: 16px; }
.chat-message.assistant .chat-bubble h3 { font-size: 15px; }
.chat-message.assistant .chat-bubble h4 { font-size: 14px; }
.chat-message.assistant .chat-bubble strong { font-weight: 600; }
.chat-message.assistant .chat-bubble code {
  font-family: var(--font-mono); font-size: 13px; background: var(--code-bg); color: var(--code-text);
  padding: 1px 5px; border-radius: 4px;
}
/* 代码块走 --code-* token（始终浅色，配 highlight-github 浅色主题，深色模式下仍浅底深字可读）*/
.chat-message.assistant .chat-bubble pre {
  background: var(--code-bg); color: var(--code-text); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 36px 14px 12px; overflow-x: auto; margin: 8px 0; position: relative;
}
/* 流式增量阶段不挂代码头（enhance=false），用常规上内边距，避免顶部空隙 */
.chat-message.assistant .chat-bubble.is-streaming pre { padding-top: 12px; }
.chat-message.assistant .chat-bubble pre code { background: none; padding: 0; font-size: 13px; line-height: 1.5; }
/* 代码块头部配件（语言标签/复制按钮）锁定浅色，避免深色模式下与浅底代码块冲突 */
.chat-message.assistant .chat-bubble .code-lang-label,
.chat-message.assistant .chat-bubble .code-copy-btn { color: var(--code-chrome-text); }
.chat-message.assistant .chat-bubble .code-copy-btn:hover { background: var(--code-chrome-hover); color: var(--code-text); }
.chat-message.assistant .chat-bubble blockquote {
  margin: 8px 0; padding: 2px 12px; border-left: 3px solid var(--primary);
  background: var(--primary-lighter); color: var(--text-secondary); border-radius: 0 4px 4px 0;
}
.chat-message.assistant .chat-bubble blockquote p:last-child { margin-bottom: 0; }
.chat-message.assistant .chat-bubble table {
  border-collapse: collapse; margin: 8px 0; font-size: 13px;
  display: block; overflow-x: auto; max-width: 100%;
}
.chat-message.assistant .chat-bubble th,
.chat-message.assistant .chat-bubble td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.chat-message.assistant .chat-bubble th { background: var(--bg-sunken); font-weight: 600; white-space: nowrap; }
.chat-message.assistant .chat-bubble tr:nth-child(even) td { background: var(--primary-lighter); }
.chat-message.assistant .chat-bubble input[type="checkbox"] { margin-right: 6px; accent-color: var(--primary); vertical-align: middle; }
.chat-message.assistant .chat-bubble a { color: var(--primary); text-decoration: none; font-weight: 500; }
.chat-message.assistant .chat-bubble a:hover { text-decoration: underline; }
.chat-message.assistant .chat-bubble img { max-width: 100%; border-radius: var(--radius-sm); margin: 6px 0; }
.chat-message.assistant .chat-bubble hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }

/* 复制按钮 */
.chat-msg-actions { display: flex; opacity: 0; transition: opacity .15s; margin-top: 4px; min-height: 22px; }
.chat-message:hover .chat-msg-actions { opacity: 1; }
.chat-msg-copy {
  width: 24px; height: 22px; border: none; background: transparent;
  color: var(--text-muted); border-radius: var(--radius-sm); cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.chat-msg-copy:hover { background: var(--bg-elevated); color: var(--text); }
.chat-msg-copy svg { width: 14px; height: 14px; }

/* 工具调用可折叠卡片 */
.chat-tools-detail {
  margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--bg); max-width: 100%;
}
.chat-tools-header {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px;
  font-size: 12px; color: var(--text-secondary); cursor: pointer; user-select: none;
}
.chat-tools-header:hover { background: var(--bg-surface-hover); }
.chat-tools-header > svg { width: 14px; height: 14px; flex-shrink: 0; }
.chat-tools-header .chevron { margin-left: auto; transition: transform .15s; width: 12px; height: 12px; }
.chat-tools-detail.expanded .chat-tools-header .chevron { transform: rotate(90deg); }
.chat-tools-body { display: none; padding: 8px; border-top: 1px solid var(--border); flex-direction: column; gap: 8px; }
.chat-tools-detail.expanded .chat-tools-body { display: flex; }
.tool-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 12px; }
.tool-card-head { display: flex; align-items: center; }
.tool-name { font-family: var(--font-mono); color: var(--primary); font-weight: 600; font-size: 12px; }
.tool-args, .tool-result pre {
  margin: 6px 0 0; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-secondary);
  white-space: pre-wrap; word-break: break-all; background: var(--bg); padding: 6px 8px; border-radius: 3px;
  max-height: 160px; overflow: auto;
}
.tool-result { margin-top: 6px; }
.tool-result-label { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.tool-result pre { margin: 0; }

.chat-input-area { padding: 16px 24px; border-top: 1px solid var(--border); background: var(--bg-surface); }
.chat-input-wrapper { display: flex; gap: 8px; align-items: flex-end; }
.chat-input {
  flex: 1; padding: 12px 16px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: 14px; font-family: inherit;
  resize: none; min-height: 44px; max-height: 120px; transition: border-color .15s;
}
.chat-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }

.typing-indicator { padding: 0 0 2px; color: var(--text-muted); font-size: 12px; line-height: 1.4; align-self: flex-start; opacity: 0.8; }
.typing-indicator .dot { display: inline-block; animation: bounce 1.4s infinite; }
.typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }
.typing-indicator.is-error { color: var(--danger); opacity: 1; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-3px); } }

/* ---- Settings · Chrome 式双栏（左垂直导航 + 搜索，右独立滚动内容区）---- */
/* 结构：[应用侧栏 256px] [设置导航 232-248px] [内容区 flex:1 · max-width 760px 居中]
   窄屏 <900px：导航收为左侧抽屉，顶栏提供汉堡开关（Chrome 移动端范式） */
.settings-layout { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); position: relative; }
@media (min-width: 900px) { .settings-layout { flex-direction: row; } }

/* —— 窄屏顶栏（桌面隐藏）—— */
.settings-topbar {
  display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 10px 0 12px;
  flex-shrink: 0; background: var(--bg-surface); border-bottom: 1px solid var(--border);
}
.settings-topbar-btn {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--text-secondary);
  border-radius: var(--radius-sm); cursor: pointer; transition: background .14s, color .14s;
}
.settings-topbar-btn:hover { background: var(--bg-surface-hover); color: var(--text); }
.settings-topbar-btn svg { width: 18px; height: 18px; }
.settings-topbar-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
@media (min-width: 900px) { .settings-topbar { display: none; } }

/* —— 左侧垂直导航 —— */
.settings-nav {
  display: flex; flex-direction: column; min-height: 0; flex-shrink: 0;
  background: var(--bg-surface); border-right: 1px solid var(--border);
}
@media (min-width: 900px)  { .settings-nav { width: 232px; } }
@media (min-width: 1280px) { .settings-nav { width: 248px; } }

/* 窄屏：抽屉 + 遮罩 */
.settings-scrim { position: absolute; left: 0; right: 0; top: 48px; bottom: 0; z-index: 25; background: rgba(15, 17, 21, 0.38); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.settings-scrim.is-open { opacity: 1; pointer-events: auto; }
@media (max-width: 899.98px) {
  /* 窄屏：设置视图占满视口（覆盖应用侧栏），复刻 Chrome 移动端整屏设置体验，
     否则 256px 应用侧栏会把 settings-layout 挤窄、导致抽屉 off-screen 计算错位 */
  .settings-layout { position: fixed; inset: 0; z-index: 50; }
  .settings-nav {
    position: absolute; top: 48px; bottom: 0; left: 0; z-index: 30;
    width: min(300px, 84vw);
    transform: translateX(-104%);
    transition: transform .22s ease;
  }
  .settings-nav.settings-drawer-open { transform: none; box-shadow: var(--shadow-lg); }
}
@media (min-width: 900px) { .settings-scrim { display: none; } }

/* —— 搜索框（Chrome 式：内凹灰底，聚焦上浮为主色描边）—— */
.settings-search { padding: 14px 12px 8px; flex-shrink: 0; position: relative; }
.settings-search-box {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius);
  background: var(--bg-sunken); border: 1px solid transparent;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.settings-search-box:focus-within { background: var(--bg-surface); border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.settings-search-box svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.settings-search-box input {
  flex: 1; min-width: 0; border: none; background: transparent; outline: none;
  color: var(--text); font-family: inherit; font-size: 13px;
}
.settings-search-box input::placeholder { color: var(--text-muted); }
.settings-search-box kbd {
  font-family: var(--font-mono); font-size: 10.5px; padding: 1px 6px; flex-shrink: 0;
  border-radius: 3px; background: var(--bg-surface); color: var(--text-muted);
  border: 1px solid var(--border); transition: opacity .15s;
}
.settings-search-box:focus-within kbd { opacity: 0.55; }

/* 搜索结果下拉 */
.settings-search-results {
  position: absolute; left: 12px; right: 12px; top: calc(100% - 4px); z-index: 40;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; max-height: 320px; overflow-y: auto;
}
.settings-search-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm); cursor: pointer;
  transition: background .1s;
}
.settings-search-item:hover, .settings-search-item.is-active { background: var(--primary-light); }
.settings-search-item .ss-title { font-size: 13.5px; font-weight: 500; color: var(--text); white-space: nowrap; }
.settings-search-item:hover .ss-title, .settings-search-item.is-active .ss-title { color: var(--primary); }
.settings-search-item .ss-crumb { font-size: 11.5px; color: var(--text-muted); flex-shrink: 0; }
.settings-search-empty { padding: 16px 10px; font-size: 12.5px; color: var(--text-muted); text-align: center; }

/* —— 导航项（胶囊选中态，Chrome pill 范式）—— */
.settings-nav-list { flex: 1; overflow-y: auto; padding: 6px 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 14px; border: none; border-radius: var(--radius-pill);
  background: transparent; color: var(--text-secondary);
  font-family: inherit; font-size: 13.5px; font-weight: 500; text-align: left; cursor: pointer;
  transition: background .14s, color .14s;
}
.settings-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.75; transition: opacity .14s; }
.settings-nav-item:hover { background: var(--bg-surface-hover); color: var(--text); }
.settings-nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.settings-nav-item.active svg { opacity: 1; }
.settings-nav-item.is-hidden { display: none; }

/* —— 右侧内容区（独立滚动）—— */
.settings-panel { flex: 1; overflow-y: auto; min-width: 0; }
.settings-panel-content { max-width: 760px; padding: 30px 36px 48px; margin: 0 auto; width: 100%; }
@media (max-width: 899.98px) { .settings-panel-content { padding: 20px 16px 40px; } }
.settings-panel-title {
  font-size: 22px; font-weight: 600; letter-spacing: -0.022em; line-height: 1.25;
  margin-bottom: 6px; color: var(--text);
}
.settings-panel-desc { font-size: 13.5px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 26px; max-width: 38em; }

/* 章节卡片 */
.settings-section {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px 24px; margin-bottom: 14px; scroll-margin-top: 12px;
}
[data-anchor] { scroll-margin-top: 12px; }
.settings-section--danger { border-color: rgba(245, 63, 63, 0.35); }

/* 卡片入场：轻上浮 + 错峰（prefers-reduced-motion 时关闭，见文件尾部统一降级） */
.settings-panel-content > .settings-section { animation: settingsSectionIn .32s ease backwards; }
.settings-panel-content > .settings-section:nth-child(4) { animation-delay: 45ms; }
.settings-panel-content > .settings-section:nth-child(5) { animation-delay: 90ms; }
@keyframes settingsSectionIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 深链锚点命中闪烁（Chrome :target 式提示） */
.settings-flash { animation: settingsFlash 1.35s ease; }
@keyframes settingsFlash {
  0%   { box-shadow: 0 0 0 0 rgba(51, 112, 255, 0); }
  18%  { box-shadow: 0 0 0 4px var(--primary-ring), 0 0 22px var(--primary-ring); border-color: var(--primary); }
  100% { box-shadow: 0 0 0 0 rgba(51, 112, 255, 0); }
}

/* —— 关于卡片 —— */
.about-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.about-avatar {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, #5B8DEF 100%);
  box-shadow: var(--shadow-xs);
}
.about-name { font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.about-slogan { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
/* 版本号独立成行：左侧标签 + 右侧等宽字体徽标，灰底凹槽与卡片分层 */
.about-version {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 18px; padding: 10px 14px;
  background: var(--bg-surface-hover); border-radius: var(--radius);
  font-size: 12.5px; color: var(--text-secondary);
}
.about-version strong {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .3px;
  padding: 2px 9px; border-radius: var(--radius-pill);
  background: var(--primary-light); color: var(--primary);
}
.about-dna { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.about-dna li {
  display: flex; gap: 12px; align-items: flex-start; padding: 10px 8px;
  border-radius: var(--radius); transition: background .14s;
}
.about-dna li:hover { background: var(--bg-surface-hover); }
.about-dna li > svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: var(--primary); }
.about-dna strong { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.about-dna span { display: block; font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; margin-top: 1px; }

/* —— 卡片内行/头部（沿用旧组件语义）—— */
.setting-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.setting-head:last-child { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  .settings-panel-content > .settings-section { animation: none; }
  .settings-flash { animation: none; }
  .settings-nav, .settings-scrim, .settings-search-box, .settings-nav-item, .about-dna li, .lh-page-btn { transition: none; }
  /* 侧栏折叠：直切，不过渡；引导呼吸提示关闭 */
  .sidebar, .sidebar-collapse, .sidebar-collapse svg, .sidebar.collapsed [data-tip]::after { transition: none; }
  .sidebar-collapse.pulse-once { animation: none; }
}
.setting-head-icon {
  width: 36px; height: 36px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.setting-head-icon svg { width: 19px; height: 19px; }
.setting-head-icon.icon-primary { background: var(--primary-light); color: var(--primary); }
.setting-head-icon.icon-success { background: rgba(0, 180, 42, 0.10); color: var(--success); }
.setting-head-icon.icon-warning { background: rgba(255, 125, 0, 0.10); color: var(--warning); }
.setting-head-icon.icon-danger { background: var(--danger-light); color: var(--danger); }
.setting-head-icon.icon-neutral { background: var(--bg-surface-hover); color: var(--text-secondary); }
.setting-head-text { flex: 1; min-width: 0; }
.setting-head-text h3 { font-family: var(--font-sans); font-size: 15px; font-weight: 600; margin-bottom: 2px; letter-spacing: -0.006em; }
.setting-head-text .section-desc { color: var(--text-secondary); font-size: 13px; line-height: 1.5; margin: 0; }
.setting-head-action { flex-shrink: 0; }
.setting-body { margin-top: 4px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.settings-row:last-child { border-bottom: none; }

/* 统计卡 · 登记册数字 */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; position: relative; overflow: hidden;
  transition: border-color .15s;
}
.stat-card:hover { border-color: var(--border-light); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; width: 2px; height: 100%; background: var(--stat-accent, var(--primary)); opacity: 0.9; }
.stat-card .stat-label { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); margin-bottom: 6px; letter-spacing: 0.06em; text-transform: uppercase; }
.stat-card .stat-value { font-family: var(--font-mono); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.stat-card .stat-unit { font-size: 13px; color: var(--text-muted); font-weight: 400; }
.stat-card.accent-success::before { background: var(--success); }
.stat-card.accent-warning::before { background: var(--warning); }
.stat-card.accent-danger::before { background: var(--danger); }

/* 配额使用进度条 */
.storage-usage { margin-top: 16px; }
.storage-usage-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.storage-usage-head > span:first-child { font-size: 13px; color: var(--text-secondary); }
.storage-usage-pct { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.storage-usage-track { height: 6px; background: var(--bg-sunken); border-radius: 3px; overflow: hidden; }
.storage-usage-bar { height: 100%; border-radius: 3px; transition: width .25s ease; }
.storage-usage-bar.fill-success { background: var(--success); }
.storage-usage-bar.fill-warning { background: var(--warning); }
.storage-usage-bar.fill-danger { background: var(--danger); }
.storage-usage-foot { margin-top: 8px; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.storage-usage-note { margin-top: 16px; padding: 12px 14px; background: var(--primary-light); border-radius: var(--radius-sm); font-size: 13px; color: var(--text-secondary); }

/* 令牌列表 */
.token-list { margin-top: 4px; }
.token-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-top: 10px; transition: border-color .15s;
}
.token-row:hover { border-color: var(--border-light); }
.token-info { min-width: 0; }
.token-label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.token-date { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.token-meta-row { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; }
.token-meta-row .dot-sep { margin: 0 6px; opacity: 0.5; }
.token-never { color: var(--text-muted); font-style: italic; }
/* 当前会话标记 */
.badge-current { background: rgba(0, 180, 42, 0.10); color: var(--success); }
.token-row-current { border-color: rgba(0, 180, 42, 0.25); }
.token-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* 紧急吊销全部 */
.token-danger-zone {
  margin-top: 16px; padding: 16px 18px;
  border: 1px solid rgba(220, 38, 38, 0.22); border-radius: var(--radius);
  background: var(--danger-light);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.token-danger-zone-text { display: flex; flex-direction: column; gap: 2px; }
.token-danger-zone-text strong { color: var(--danger); font-size: 13px; }
.token-danger-zone-text span { color: var(--text-muted); font-size: 12px; }

/* 创建令牌：有效期预设 */
.expiry-options { display: flex; gap: 8px; flex-wrap: wrap; }
.expiry-option {
  padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text-secondary); font-size: 13px; cursor: pointer;
  font-family: inherit; transition: border-color .15s, color .15s, background .15s;
}
.expiry-option:hover { border-color: var(--border-light); color: var(--text); }
.expiry-option.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }

/* 令牌结果展示 */
.token-result { display: flex; gap: 8px; align-items: stretch; margin: 12px 0 4px; }
.token-result-value {
  flex: 1; display: block; padding: 12px 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--font-mono); font-size: 13px; line-height: 1.5;
  word-break: break-all; user-select: all; max-height: 120px; overflow: auto;
}

/* Compact stacked form */
.setting-form { display: flex; flex-direction: column; gap: 14px; max-width: 360px; }
.setting-form .form-group { margin-bottom: 0; }
.setting-empty { color: var(--text-muted); font-size: 13px; margin-top: 10px; }
.setting-meta { color: var(--text-muted); font-size: 13px; margin: 2px 0 0; }

/* ---- 偏好设置章节：修饰键风格 / 侧栏默认态 / 云同步 ---- */
.prefs-radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.prefs-radio, .prefs-check {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
  border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
  font-size: 13px; color: var(--text-secondary); background: var(--bg-surface);
  transition: border-color .15s, background .15s, color .15s;
}
.prefs-radio:hover, .prefs-check:hover { border-color: var(--primary); }
.prefs-radio:focus-within, .prefs-check:focus-within { outline: 2px solid var(--primary-ring); outline-offset: 1px; }
.prefs-radio:has(input:checked), .prefs-check:has(input:checked) {
  border-color: var(--primary); background: var(--primary-lighter);
  color: var(--primary); font-weight: 500;
}
.prefs-radio input, .prefs-check input { accent-color: var(--primary); margin: 0; }
.prefs-check { margin: 0 0 8px; }

/* ---- 修改密码弹窗 · 强度条（弱=红 中=橙 强=绿，走语义 token）---- */
.pwd-strength { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.pwd-strength[hidden] { display: none; }
.pwd-strength-bar { flex: 0 0 96px; height: 4px; border-radius: var(--radius-pill); background: var(--bg-sunken); overflow: hidden; }
.pwd-strength-bar i { display: block; height: 100%; width: 0; border-radius: var(--radius-pill); transition: width .2s ease, background .2s ease; }
.pwd-strength-label { font-size: 12px; color: var(--text-muted); min-width: 1em; }
.pwd-strength.lvl-1 .pwd-strength-bar i { width: 33%; background: var(--danger); }
.pwd-strength.lvl-2 .pwd-strength-bar i { width: 66%; background: var(--warning); }
.pwd-strength.lvl-3 .pwd-strength-bar i { width: 100%; background: var(--success); }
.pwd-strength.lvl-1 .pwd-strength-label { color: var(--danger); }
.pwd-strength.lvl-2 .pwd-strength-label { color: var(--warning); }
.pwd-strength.lvl-3 .pwd-strength-label { color: var(--success); }
@media (prefers-reduced-motion: reduce) {
  .pwd-strength-bar i { transition: none; }
}

/* ---- 密码框组件 · 眼睛切换 + CapsLock 提示（mountPasswordField 装饰既有 input）---- */
.pwd-field { display: block; }
.pwd-field-inner { position: relative; display: flex; }
.pwd-field-inner > .form-input { flex: 1; min-width: 0; padding-right: 42px; }
.pwd-eye {
  position: absolute; top: 0; right: 0; bottom: 0; width: 38px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; cursor: pointer;
  color: var(--text-muted); border-radius: 0 var(--radius) var(--radius) 0;
}
.pwd-eye:hover { color: var(--text-secondary); background: var(--bg-surface-hover); }
.pwd-eye svg { width: 18px; height: 18px; }
.pwd-eye.is-on { color: var(--primary); }
.pwd-capslock { margin-top: 6px; font-size: 12px; color: var(--warning); display: flex; align-items: center; gap: 4px; }
.pwd-capslock::before { content: "⇪"; font-size: 13px; }
.pwd-capslock[hidden] { display: none; }

/* ---- 按钮 loading 态（重建索引等长任务）---- */
.btn-loading svg { animation: btnSpin 1s linear infinite; }
@keyframes btnSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .btn-loading svg { animation: none; }
}

/* 徽章 */
.badge { display: inline-block; padding: 2px 8px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 500; white-space: nowrap; }
.badge-success { background: rgba(0, 180, 42, 0.10); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: rgba(255, 125, 0, 0.10); color: var(--warning); }
.badge-info { background: var(--primary-light); color: var(--primary); }
.badge-group { background: var(--primary-light); color: var(--primary); }

/* ---- Toast ---- */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 1001; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 16px; background: var(--bg-elevated); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); font-size: 13px; max-width: 360px;
  animation: slideIn 0.2s;
}
.toast.success { border-left: 2px solid var(--success); }
.toast.error { border-left: 2px solid var(--danger); }
.toast.warning { border-left: 2px solid var(--warning); }
.toast.info { border-left: 2px solid var(--primary); }
.toast-action {
  margin-left: 12px; padding: 2px 10px; font-size: 12px; font-weight: 600;
  background: var(--primary); color: #fff; border: none; border-radius: var(--radius-xs);
  cursor: pointer; vertical-align: middle;
}
.toast-action:hover { background: var(--primary-hover); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---- 回收站角标 ---- */
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: auto;
  font-size: 11px; font-weight: 600; color: #fff; background: var(--text-muted);
  border-radius: 9px; line-height: 1;
}
.nav-badge:not([hidden]) { display: inline-flex; }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(31, 35, 41, 0.45); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 999;
}
.modal {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; width: 420px; max-width: 90vw; box-shadow: var(--shadow);
}
.modal h3 { font-family: var(--font-sans); margin-bottom: 16px; font-size: 16px; font-weight: 600; letter-spacing: -0.011em; }
.confirm-message { font-size: 14px; line-height: 1.6; color: var(--text-secondary); white-space: pre-wrap; word-break: break-word; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 24px; }

/* ---- Context Menu ---- */
.context-menu {
  position: fixed; background: var(--bg-elevated); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); z-index: 1002;
  min-width: 160px; overflow: hidden; padding: 4px;
}
.context-menu-item { padding: 8px 12px; font-size: 13px; cursor: pointer; border-radius: var(--radius-sm); display: flex; align-items: center; gap: 8px; }
.context-menu-item:hover { background: var(--bg-surface-hover); }
.context-menu-item.danger { color: var(--danger); }
.context-menu-item svg { width: 15px; height: 15px; }

/* ---- File Preview ---- */
.preview-overlay { position: fixed; inset: 0; background: var(--bg); z-index: 2000; display: flex; flex-direction: column; }
/* 笔记预览：浅色画布 + 自适中文字栏（替换"深色遮罩+一张白卡"） */
.preview-overlay--note { background: var(--bg); }
.preview-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bg-surface); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.preview-title { flex: 1; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-actions { display: flex; gap: 4px; flex-shrink: 0; }
.preview-body { flex: 1; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 32px 24px; }
.preview-loading, .preview-error { color: var(--text-secondary); font-size: 14px; }
.preview-image { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius); }
.preview-video { max-width: 100%; max-height: 100%; border-radius: var(--radius); background: #000; will-change: transform; }
.preview-video:fullscreen { border-radius: 0; }
.preview-video-overlay .preview-body { overflow: hidden; }
.preview-pdf { width: 100%; height: 100%; border: none; border-radius: var(--radius); }
.preview-audio-wrapper { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.preview-audio-wrapper svg { width: 80px; height: 80px; color: var(--primary); }
.preview-audio { width: 320px; max-width: 90vw; }
.preview-text-wrapper { display: flex; width: 100%; max-width: 960px; height: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.preview-line-numbers {
  flex-shrink: 0; padding: 16px 12px; text-align: right; background: var(--bg-surface);
  color: var(--text-muted); font-family: var(--font-mono); font-size: 13px; line-height: 1.6;
  white-space: pre; user-select: none; overflow: hidden; border-right: 1px solid var(--border);
}
.preview-text-code { flex: 1; padding: 16px; margin: 0; font-family: var(--font-mono); font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; overflow: auto; color: var(--text); }
.preview-truncated { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 8px 16px; background: var(--warning); color: #FFFFFF; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; }

/* ---- Groups / Data table ---- */
.data-table { width: 100%; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; border-collapse: collapse; }
.data-table th { text-align: left; padding: 10px 14px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-surface-hover); }

.group-folder .file-icon { color: var(--primary); }
.group-folder .file-name { font-weight: 600; }

/* ---- Account Info ---- */
.account-info { display: flex; flex-direction: column; gap: 16px; }
.account-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); }
.account-avatar {
  width: 44px; height: 44px; border-radius: var(--radius);
  background: var(--primary-light); color: var(--primary);
  font-family: var(--font-sans); font-size: 20px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  border: 1px solid var(--primary);
}
.account-name { min-width: 0; }
.account-username { font-size: 16px; font-weight: 600; color: var(--text); line-height: 1.3; word-break: break-all; }
.account-sub { margin-top: 4px; font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.account-grid > div:empty { visibility: hidden; }   /* 奇数项时末尾空格不显灰块 */
.account-field { background: var(--bg-surface); padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.account-label { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; }
.account-value { font-size: 14px; color: var(--text); font-weight: 500; word-break: break-all; }

/* ---- 账户页：登录历史 ---- */
.login-history { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.lh-title { padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--text); background: var(--bg-surface); border-bottom: 1px solid var(--border-light); }
.lh-list { background: var(--bg-surface); }
.lh-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.lh-item:last-child { border-bottom: none; }
.lh-dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: var(--text-muted); }
.lh-dot.ok { background: var(--success); }
.lh-dot.warn { background: var(--warning); }
.lh-dot.fail { background: var(--danger); }
.lh-text { font-weight: 500; color: var(--text); flex-shrink: 0; }
.lh-detail { color: var(--text-muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lh-time { color: var(--text-muted); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.lh-empty { padding: 16px; text-align: center; font-size: 13px; color: var(--text-muted); }
.lh-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-right: 10px; background: var(--bg-surface); border-bottom: 1px solid var(--border-light); }
.lh-head .lh-title { border-bottom: none; }
.lh-filters { display: flex; gap: 4px; }
.lh-chip {
  border: 1px solid transparent; background: transparent; cursor: pointer;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 12px; color: var(--text-secondary); font-family: inherit;
  transition: background .15s, color .15s;
}
.lh-chip:hover { background: var(--bg-surface-hover); }
.lh-chip.is-active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
/* 分页条：与列表同底，细分隔线衔接；切页/切分类时整块短暂降透明度示意在途，不闪布局 */
.login-history { transition: opacity .15s; }
.login-history.is-loading { opacity: .5; }
.lh-pager {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px; background: var(--bg-surface); border-top: 1px solid var(--border-light);
}
.lh-pager-info { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.lh-pager-btns { display: flex; gap: 6px; }
.lh-page-btn {
  cursor: pointer; font-family: inherit; font-size: 12px; color: var(--text-secondary);
  padding: 4px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: transparent; transition: border-color .15s, color .15s, background .15s;
}
.lh-page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.lh-page-btn:disabled { opacity: .4; cursor: default; }

/* ---- Transfer Assistant (文件传输助手) ---- */
.transfer-container { background: var(--bg); }
.transfer-messages { padding: 24px; gap: 14px; }
.transfer-msg { align-self: flex-end; max-width: 80%; display: flex; align-items: flex-start; gap: 8px; position: relative; }
.transfer-msg-body { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 0; }
.transfer-text-bubble { padding: 10px 14px; border-radius: var(--radius); background: var(--bg-surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-xs); font-size: 14px; line-height: 1.6; word-break: break-word; }  /* 自发文本=中性便签卡，品牌色不用于内容底色（§3）*/
.transfer-file-card {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
  transition: border-color .15s, background .15s; min-width: 240px; max-width: 360px;
}
.transfer-file-card:hover { border-color: var(--primary); background: var(--bg-surface-hover); }
.transfer-file-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: var(--radius-sm); background: var(--bg-elevated); }
.transfer-file-icon svg { width: 20px; height: 20px; }
.transfer-file-icon.folder { color: var(--primary); }
.transfer-file-icon.code { color: #86909C; }
.transfer-file-icon.doc { color: var(--text-secondary); }
.transfer-file-icon.image { color: var(--success); }
.transfer-file-icon.video { color: #B37FEB; }
.transfer-file-icon.audio { color: var(--danger); }
.transfer-file-icon.other { color: var(--text-muted); }
.transfer-file-info { flex: 1; min-width: 0; }
.transfer-file-name { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.transfer-file-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.transfer-saved { color: var(--success); }
.transfer-file-dl { flex-shrink: 0; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; color: var(--text-secondary); border-radius: var(--radius-sm); cursor: pointer; transition: background .15s, color .15s; }
.transfer-file-dl:hover { background: var(--bg-elevated); color: var(--primary); }
.transfer-file-dl svg { width: 18px; height: 18px; }
.transfer-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.transfer-file-guard { font-family: var(--font-mono); font-size: 11px; padding: 2px 8px; border-radius: var(--radius-sm); }
.transfer-file-guard.warning { background: rgba(255, 125, 0, 0.10); color: var(--warning); }
.transfer-del { opacity: 0; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; color: var(--text-muted); border-radius: var(--radius-sm); cursor: pointer; transition: opacity .15s, color .15s, background .15s; align-self: center; }
.transfer-msg:hover .transfer-del { opacity: 1; }
.transfer-del:hover { color: var(--danger); background: var(--danger-light); }
.transfer-del svg { width: 16px; height: 16px; }
.transfer-input-area { padding: 12px 24px; }
.transfer-input-wrapper { gap: 8px; }
.transfer-empty { margin: auto; text-align: center; color: var(--text-muted); padding: 40px 20px; }
.transfer-empty-icon { width: 64px; height: 64px; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; background: var(--primary-light); color: var(--primary); border-radius: 14px; }  /* 与 .notes-empty-icon 统一：填充+无边框+14 圆角 */
.transfer-empty-icon svg { width: 30px; height: 30px; }
.transfer-empty-title { font-family: var(--font-sans); font-size: 16px; font-weight: 600; letter-spacing: -0.011em; color: var(--text); margin-bottom: 6px; }
.transfer-empty-desc { font-size: 13px; color: var(--text-muted); max-width: 320px; line-height: 1.6; }
.transfer-loading { margin: auto; text-align: center; color: var(--text-muted); padding: 40px 20px; }
.transfer-loading-spinner { width: 32px; height: 32px; margin: 0 auto 14px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: transfer-spin 0.8s linear infinite; }
.transfer-loading-text { font-size: 13px; }
.transfer-media { display: flex; flex-direction: column; align-items: flex-end; }
.transfer-media-img { display: block; max-width: min(280px, 100%); max-height: 360px; border-radius: var(--radius); object-fit: contain; cursor: zoom-in; background: var(--bg-elevated); border: 1px solid var(--border); }
.transfer-media-video { position: relative; max-width: min(320px, 100%); border-radius: var(--radius); overflow: hidden; cursor: pointer; background: #000; }
.transfer-media-video-thumb { display: block; max-width: 100%; max-height: 380px; object-fit: cover; }
.transfer-media-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.transfer-media-play::before { content: ''; position: absolute; width: 52px; height: 52px; border-radius: 50%; background: rgba(0,0,0,0.55); }
.transfer-media-play svg { position: relative; width: 24px; height: 24px; color: #fff; margin-left: 2px; }
.transfer-media-audio { width: min(300px, 100%); }
.transfer-media-actions { display: flex; gap: 2px; align-self: center; opacity: 0; transition: opacity .15s; }
.transfer-msg:hover .transfer-media-actions { opacity: 1; }
.transfer-media-dl { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; color: var(--text-muted); border-radius: var(--radius-sm); cursor: pointer; transition: color .15s, background .15s; }
.transfer-media-dl:hover { color: var(--primary); background: var(--bg-elevated); }
.transfer-media-dl svg { width: 16px; height: 16px; }
@keyframes transferMsgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.transfer-msg.is-new { animation: transferMsgIn .2s ease; }
/* 离场 transition 时长若调整，务必同步 app.js 的 TRANSFER_LEAVE_MS 兜底移除时长 */
.transfer-msg.is-leaving { opacity: 0; transform: scale(.96); transition: opacity .18s ease, transform .18s ease; pointer-events: none; }
@media (max-width: 768px) {
  .transfer-msg { max-width: 90%; }
  .transfer-file-card { min-width: 0; max-width: 100%; }
}

/* ============ Landing · 随行档（现代 SaaS · taste-skill 校准） ============ */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.sx-page {
  /* 旧名映射到全局 token（renderLanding 已废弃，样式留存兼容；统一飞书蓝 #3370FF）*/
  --bg-soft: var(--bg-sunken); --ink-2: var(--text-secondary); --ink-3: var(--text-muted);
  --line: var(--border); --line-2: var(--border-strong);
  --brand: var(--primary); --brand-2: var(--primary-hover); --brand-soft: var(--primary-bg); --brand-line: var(--border);
  --r-sm: var(--radius-sm); --r: var(--radius); --r-lg: var(--radius-lg); --r-pill: var(--radius-pill);
  --maxw: 1120px;
  position: relative; min-height: 100vh; min-height: 100dvh; background: var(--bg-surface); color: var(--text);
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', system-ui, sans-serif;
  font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
.sx-page h1, .sx-page h2 { font-weight: 600; line-height: 1.06; letter-spacing: -0.028em; }
.sx-page h3 { font-weight: 600; letter-spacing: -0.012em; }
/* 统一图标描边：覆盖 inline stroke-width，飞书/Notion 式偏实线条 */
.sx-page svg { stroke-width: 2; }
/* 登录 banner 复用的小印鉴标签（全局 utility，勿删）*/
.sx-stamp { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--amber, var(--seal, currentColor)); color: var(--amber, var(--seal, inherit)); background: transparent; }

/* ---- 顶栏（单行 · 60px）---- */
.sx-bar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 28px; height: 60px; padding: 0 32px; background: rgba(255,255,255,0.8); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line); }
.sx-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.sx-mark { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; color: #fff; background: var(--brand); box-shadow: var(--shadow-xs); }
.sx-mark--sm { width: 22px; height: 22px; font-size: 12px; border-radius: 6px; }
.sx-brand-meta { display: flex; flex-direction: row; align-items: baseline; gap: 8px; white-space: nowrap; line-height: 1.2; }
.sx-brand-name { font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.sx-brand-sub { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.sx-brand-sub::before { content: "·"; margin-right: 8px; color: var(--line-2); }
.sx-bar-nav { display: flex; gap: 26px; margin-left: 8px; }
.sx-bar-nav a { font-size: 14px; color: var(--ink-2); text-decoration: none; transition: color .15s; }
.sx-bar-nav a:hover { color: var(--ink); }
.sx-bar-cta { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.sx-link { font: inherit; font-size: 14px; cursor: pointer; padding: 7px 14px; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; color: var(--ink); transition: background .15s; }
.sx-link:hover { background: var(--bg-soft); }
.sx-link--solid { background: var(--brand); color: #fff; font-weight: 500; border-color: var(--brand); }
.sx-link--solid:hover { background: var(--brand-2); border-color: var(--brand-2); }

/* ---- Hero（居中 · 紧凑 · pt 上限 ~96）---- */
.sx-hero { position: relative; overflow: hidden; padding: 72px 32px 52px; text-align: center; }
.sx-hero::before { content: ""; position: absolute; top: -240px; left: 50%; transform: translateX(-50%); width: 820px; height: 520px; background: radial-gradient(ellipse at center, rgba(43,95,255,0.08), transparent 60%); pointer-events: none; }
.sx-hero-inner { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; }
.sx-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--brand); background: var(--brand-soft); border: 1px solid var(--brand-line); padding: 5px 12px; border-radius: var(--r-pill); margin-bottom: 22px; }
.sx-hero h1 { font-size: clamp(36px, 5.6vw, 60px); margin: 0 auto 18px; max-width: 15em; font-weight: 700; }
.sx-hero h1 .sx-accent { color: var(--brand); }
.sx-hero-lead { font-size: clamp(15.5px, 1.4vw, 18px); color: var(--ink-2); max-width: 38em; margin: 0 auto 30px; line-height: 1.6; }
.sx-hero-cta { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 52px; flex-wrap: wrap; }
.sx-btn { font: inherit; font-size: 14.5px; cursor: pointer; padding: 11px 20px; border-radius: var(--r-sm); border: 1px solid var(--brand); background: var(--brand); color: #fff; font-weight: 500; transition: background .15s, border-color .15s; display: inline-flex; align-items: center; gap: 7px; }
.sx-btn:hover { background: var(--brand-2); border-color: var(--brand-2); }
.sx-btn:active { transform: scale(0.98); }
.sx-btn--ghost { background: #fff; color: var(--ink); border-color: var(--line-2); box-shadow: none; }
.sx-btn--ghost:hover { background: var(--bg-soft); border-color: var(--ink-3); color: var(--ink); }
.sx-btn--lg { padding: 13px 28px; font-size: 15px; }
.sx-arrow { transition: transform .15s; display: inline-block; }
.sx-btn:hover .sx-arrow { transform: translateX(3px); }
.sx-ico--arrow { width: 1em; height: 1em; vertical-align: -0.125em; }
.sx-ico--arrow-back { width: 1em; height: 1em; vertical-align: -0.125em; transform: scaleX(-1); }
@media (prefers-reduced-motion: reduce) { .sx-btn:hover, .sx-btn--ghost:hover { transform: none; } .sx-btn:hover .sx-arrow { transform: none; } }

/* ---- 产品预览 mockup（真实组件预览）---- */
.sx-mockup { max-width: 1000px; margin: 0 auto; border-radius: var(--r-lg); overflow: hidden; background: var(--bg-soft); border: 1px solid var(--line); box-shadow: var(--shadow-lg); text-align: left; }
.sx-mockup-bar { display: flex; align-items: center; gap: 6px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fff; }
.sx-mockup-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.sx-mockup-body { display: grid; grid-template-columns: 184px 1fr; min-height: 320px; }
.sx-mockup-side { background: #fff; border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 1px; }
.sx-mockup-sideh { font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 10px; margin-bottom: 4px; }
.sx-mockup-item { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: var(--r-sm); font-size: 13.5px; color: var(--ink-2); }
.sx-mockup-item.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.sx-mockup-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.sx-mockup-main { padding: 20px 22px; display: flex; flex-direction: column; gap: 11px; justify-content: flex-end; }
.sx-mockup-q { align-self: flex-end; max-width: 68%; background: var(--brand); color: #fff; padding: 9px 13px; border-radius: var(--r); font-size: 13.5px; line-height: 1.5; }
.sx-mockup-a { align-self: flex-start; max-width: 84%; background: #fff; border: 1px solid var(--line); padding: 11px 13px; border-radius: var(--r); font-size: 13.5px; color: var(--ink); line-height: 1.6; box-shadow: var(--shadow-sm); }
.sx-mockup-a strong { color: var(--brand); font-weight: 600; }
.sx-mockup-files { display: flex; gap: 7px; flex-wrap: wrap; }
.sx-mockup-chip { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); padding: 4px 9px; border-radius: 7px; font-size: 12px; color: var(--ink-2); }
.sx-mockup-chip svg { width: 13px; height: 13px; color: var(--ink-3); }

/* ---- 通用 section（更紧的节奏）---- */
.sx-section { padding: 72px 32px; scroll-margin-top: 60px; }
.sx-section--soft { background: var(--bg-soft); }
.sx-container { max-width: var(--maxw); margin: 0 auto; }
/* 左对齐 section 头（竖向堆叠，非居中模板、非 split-header）*/
.sx-head { max-width: 38em; margin: 0 0 36px; }
.sx-head--center { margin-left: auto; margin-right: auto; text-align: center; }
.sx-head h2 { font-size: clamp(26px, 3.4vw, 36px); margin-bottom: 12px; }
.sx-head p { font-size: 16px; color: var(--ink-2); line-height: 1.6; }

/* ---- 功能：非对称 bento（4 列宽窄交错，非 3 等卡）---- */
.sx-bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.sx-cell { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 22px; display: flex; flex-direction: column; transition: border-color .18s, transform .18s, box-shadow .18s; }
.sx-cell:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.sx-cell--wide { grid-column: span 2; }
.sx-cell--tint { background: var(--brand-soft); border-color: var(--brand-line); }
.sx-cell-ico { width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 14px; }
.sx-cell--tint .sx-cell-ico { background: #fff; border: 1px solid var(--brand-line); }
.sx-cell-ico svg { width: 19px; height: 19px; }
.sx-cell h3 { font-size: 16.5px; margin-bottom: 6px; }
.sx-cell p { font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.sx-cell-art { margin-top: 14px; }
.sx-searchbar { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 11px; font-size: 12.5px; color: var(--ink-3); }
.sx-searchbar svg { width: 14px; height: 14px; }
.sx-searchbar .sx-cursor { display: inline-block; width: 1.5px; height: 13px; background: var(--brand); vertical-align: middle; }

/* ---- 零痕迹：列表族（divide-y 行，非卡片网格）---- */
.sx-list { border-top: 1px solid var(--line); }
.sx-list-row { display: grid; grid-template-columns: 40px 1fr; gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--line); align-items: start; }
.sx-list-ico { width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); }
.sx-list-ico svg { width: 19px; height: 19px; }
.sx-list-row h3 { font-size: 17px; margin-bottom: 5px; }
.sx-list-row p { font-size: 14.5px; color: var(--ink-2); line-height: 1.6; max-width: 48em; }

/* ---- 接入：流程族（节点 + 箭头，与卡片/列表区隔）---- */
.sx-flow { display: grid; grid-template-columns: 1fr 28px 1fr 28px 1fr; align-items: stretch; }
.sx-flow-node { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.sx-flow-ico { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); }
.sx-flow-ico svg { width: 20px; height: 20px; }
.sx-flow-node--hub { border-color: var(--brand-line); background: var(--brand-soft); }
.sx-flow-node--hub .sx-flow-ico { background: var(--brand); color: #fff; }
.sx-flow-node h3 { font-size: 17px; }
.sx-flow-node p { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.sx-flow-arrow { display: flex; align-items: center; justify-content: center; color: var(--ink-3); }
.sx-flow-arrow svg { width: 18px; height: 18px; }

/* ---- 对话演示：不用翻文件夹，直接问 ---- */
.sx-demo-chat { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.sx-demo-q { align-self: flex-end; max-width: 74%; background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--r); font-size: 14.5px; line-height: 1.5; }
.sx-demo-a { align-self: flex-start; max-width: 86%; background: #fff; border: 1px solid var(--line); padding: 14px 16px; border-radius: var(--r); font-size: 14px; color: var(--ink); line-height: 1.65; box-shadow: var(--shadow-sm); }
.sx-demo-a strong { color: var(--brand); font-weight: 600; }
.sx-demo-cite { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 12px; color: var(--ink-3); background: var(--bg-soft); padding: 4px 9px; border-radius: var(--r-sm); }
.sx-demo-cite svg { width: 12px; height: 12px; }
.sx-demo-act { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 13px; color: var(--brand); font-weight: 500; }

/* ---- Guard：方向感知对照表 ---- */
.sx-guard-table { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.sx-guard-head, .sx-guard-row { display: grid; grid-template-columns: 1.5fr 1fr 1fr; align-items: center; }
.sx-guard-head { background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.sx-guard-head > span { padding: 13px 18px; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }
.sx-guard-row { border-bottom: 1px solid var(--line); }
.sx-guard-row:last-child { border-bottom: none; }
.sx-guard-row > span { padding: 15px 18px; font-size: 14px; }
.sx-guard-file { font-weight: 500; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.sx-guard-file svg { width: 16px; height: 16px; color: var(--ink-3); flex-shrink: 0; }
.sx-guard-verdict { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.sx-guard-verdict svg { width: 15px; height: 15px; }
.sx-guard-block { color: var(--danger); }
.sx-guard-warn { color: var(--warning); }
.sx-guard-pass { color: var(--success); }

/* ---- 部署：终端 + 技术事实 ---- */
.sx-deploy-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 44px; align-items: start; }
.sx-terminal { background: #14151A; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.sx-terminal-bar { display: flex; align-items: center; gap: 6px; padding: 11px 14px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.sx-terminal-bar > span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.13); }
.sx-terminal-body { padding: 18px 18px 22px; font-family: var(--font-mono); font-size: 13px; line-height: 1.95; color: #9DA3B0; white-space: pre; overflow-x: auto; }
.sx-terminal-body .sx-cmd { color: #6CA8FF; }
.sx-terminal-body .sx-comment { color: #52565F; }
.sx-terminal-body .sx-ok { color: #4ADE80; }
.sx-deploy-facts { display: flex; flex-direction: column; gap: 20px; }
.sx-fact { display: flex; gap: 13px; align-items: start; }
.sx-fact-ico { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
.sx-fact-ico svg { width: 17px; height: 17px; }
.sx-fact h4 { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.sx-fact p { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }

/* ---- 结尾 outro（替代渐变 CTA 岛）---- */
.sx-outro { padding: 88px 32px; border-top: 1px solid var(--line); }
.sx-outro-inner { max-width: var(--maxw); margin: 0 auto; }
.sx-outro h2 { font-size: clamp(28px, 3.6vw, 42px); font-weight: 700; line-height: 1.08; letter-spacing: -0.025em; margin-bottom: 14px; max-width: 14em; }
.sx-outro > .sx-outro-inner > p { font-size: 16px; color: var(--ink-2); line-height: 1.6; max-width: 34em; margin-bottom: 28px; }
.sx-outro-cta { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.sx-outro-link { font-size: 14px; color: var(--ink-2); text-decoration: none; transition: color .15s; display: inline-flex; align-items: center; gap: 4px; }
.sx-outro-link:hover { color: var(--ink); }

/* ---- Footer ---- */
.sx-foot { border-top: 1px solid var(--line); padding: 32px 32px; background: var(--bg); }
.sx-foot-inner { max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sx-foot-brand { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.sx-foot-links { display: flex; gap: 22px; margin-left: auto; }
.sx-foot-links a { color: var(--ink-2); text-decoration: none; font-size: 14px; transition: color .15s; }
.sx-foot-links a:hover { color: var(--ink); }
.sx-foot-copy { color: var(--ink-3); font-size: 13px; }

/* ---- 响应式 ---- */
@media (max-width: 900px) {
  .sx-bento { grid-template-columns: repeat(2, 1fr); }
  .sx-cell--wide { grid-column: span 2; }
  .sx-flow { grid-template-columns: 1fr; gap: 10px; }
  .sx-flow-arrow { transform: rotate(90deg); padding: 2px 0; }
  .sx-mockup-body { grid-template-columns: 1fr; min-height: auto; }
  .sx-mockup-side { display: none; }
  .sx-bar-nav { display: none; }
  .sx-section, .sx-outro { padding: 56px 22px; }
  .sx-head { margin-bottom: 28px; }
  .sx-deploy-grid { grid-template-columns: 1fr; gap: 28px; }
  .sx-guard-row > span { padding: 13px 14px; }
}
@media (max-width: 600px) {
  .sx-bar { padding: 0 18px; gap: 10px; }
  .sx-brand-sub { display: none; }
  .sx-hero { padding: 48px 20px 40px; }
  .sx-bento { grid-template-columns: 1fr; }
  .sx-cell--wide { grid-column: span 1; }
  .sx-hero-cta { flex-direction: column; width: 100%; }
  .sx-hero-cta .sx-btn { width: 100%; justify-content: center; }
  .sx-guard-head, .sx-guard-row { grid-template-columns: 1fr; }
  .sx-guard-head { display: none; }
  .sx-guard-row { padding: 14px 16px; border-bottom: 1px solid var(--line); gap: 4px; }
  .sx-guard-row > span { padding: 2px 0; }
  .sx-guard-file::before { content: none; }
  .sx-outro-cta { flex-direction: column; align-items: stretch; gap: 14px; }
  .sx-outro-link { justify-content: center; }
}

/* ---- App 响应式 ---- */
@media (max-width: 720px) {
  /* 窄屏：表头隐藏，行降为 名称+操作 两列，可见 cell 数与列数严格匹配（R2） */
  .file-table { --file-cols: minmax(0, 1fr) auto; }
  .file-table-head { display: none; }
  .file-row .file-cell--type,
  .file-row .file-cell--size,
  .file-row .file-cell--date { display: none; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar .btn span { display: none; }
  .files-body { padding: 14px; }
  .files-header { padding: 12px 14px; }
  .file-controls { gap: 2px; }
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 8px; }
  .batch-bar { gap: 6px; }
  .chat-messages { padding: 12px; }
  .chat-message { max-width: 95%; }
  .upload-list { width: calc(100vw - 24px); right: 12px; bottom: 12px; }
  .preview-body { padding: 12px; }
  .preview-line-numbers { display: none; }
  .preview-text-wrapper { height: auto; max-height: 100%; }
  .quota-ring { display: none; }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- 可访问性：键盘聚焦 ---- */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---- 降级动效：尊重 prefers-reduced-motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .btn:active:not(:disabled), .file-card:hover, .stat-card:hover, .sidebar-logo:hover, .nav-btn:hover { transform: none !important; }
}

/* ---- Settings 工具类（替代 inline style）---- */
.setting-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.setting-row > .setting-row-text { margin: 0; flex: 1; min-width: 200px; }

/* 笔记预览时隐藏滚动条背后的暗色，让阅读栏落在浅色画布上 */
.preview-overlay--note .preview-body::-webkit-scrollbar { width: 8px; }
.preview-overlay--note .preview-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ============================================================
   Markdown 渲染排版系统（4px 基准网格 · 类型阶梯 · 语义色）
   ============================================================ */
.markdown-body { font-size: 15px; line-height: 1.8; color: var(--text); word-wrap: break-word; }
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
  margin: 28px 0 12px; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em;
}
.markdown-body h1:first-child, .markdown-body h2:first-child { margin-top: 0; }
.markdown-body h1 { font-size: 1.75em; font-weight: 700; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.markdown-body h2 { font-size: 1.45em; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.markdown-body h3 { font-size: 1.2em; }
.markdown-body h4 { font-size: 1.05em; color: var(--text-secondary); }
.markdown-body h5 { font-size: 0.95em; color: var(--text-secondary); }
.markdown-body h6 { font-size: 0.88em; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.markdown-body p { margin: 0 0 14px; }
.markdown-body ul, .markdown-body ol { margin: 0 0 14px; padding-left: 24px; }
.markdown-body li { margin: 4px 0; }
.markdown-body li > ul, .markdown-body li > ol { margin: 4px 0; }
.markdown-body blockquote {
  margin: 0 0 14px; padding: 8px 16px; border-left: 3px solid var(--primary);
  background: var(--primary-light); color: var(--text-secondary);
  border-radius: 0 6px 6px 0;
}
.markdown-body blockquote p:last-child { margin-bottom: 0; }
.markdown-body code {
  font-family: var(--font-mono); font-size: 0.88em;
  background: var(--bg-sunken); padding: 2px 6px; border-radius: 4px;
}
.markdown-body pre {
  margin: 0 0 14px; padding: 14px 16px; padding-top: 36px;
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: 8px; overflow-x: auto; position: relative;
}
.markdown-body pre code { background: none; padding: 0; font-size: 13px; line-height: 1.65; }
.code-block-header {
  position: absolute; top: 0; right: 0; left: 0;
  display: flex; align-items: center; justify-content: flex-end; gap: 6px;
  padding: 5px 8px; height: 28px; border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.02);
}
.code-lang-label {
  margin-right: auto; font-family: var(--font-mono); font-size: 11px;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em;
}
.code-copy-btn {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border: none; background: transparent;
  color: var(--text-muted); border-radius: 4px; cursor: pointer;
  transition: background .12s, color .12s;
}
.code-copy-btn:hover { background: var(--bg-surface-hover); color: var(--text); }
.code-copy-btn svg { width: 13px; height: 13px; }
.code-copy-btn.is-copied { color: var(--success); }
.markdown-body a { color: var(--primary); text-decoration: none; font-weight: 500; }
.markdown-body a:hover { text-decoration: underline; }
.markdown-body img { max-width: 100%; border-radius: 8px; margin: 8px 0; }
.markdown-body table {
  width: 100%; border-collapse: collapse; margin: 0 0 14px;
  font-size: 13.5px; border-radius: 6px; overflow: hidden;
}
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.markdown-body th { background: var(--bg-sunken); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.markdown-body tr:nth-child(even) td { background: rgba(0, 0, 0, 0.015); }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.markdown-body input[type="checkbox"] { margin-right: 6px; accent-color: var(--primary); }
.markdown-body .mermaid-chart { display: flex; justify-content: center; padding: 16px; background: var(--bg-sunken); border-radius: 8px; margin: 0 0 14px; }
.markdown-body .mermaid-chart svg { max-width: 100%; height: auto; }

/* ---- Markdown 预览（笔记）---- */
.preview-overlay--note .preview-body { align-items: flex-start; }
.preview-note { max-width: 880px; width: 100%; margin: 0 auto; padding: 48px 56px; background: var(--bg-surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.preview-toc { position: fixed; top: 60px; right: 24px; width: 220px; max-height: 70vh; overflow-y: auto; padding: 16px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 2100; }
.preview-toc.is-hidden { display: none; }
.preview-toc-title { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .04em; }
.preview-toc-item { display: block; padding: 4px 8px; font-size: 13px; color: var(--text-secondary); text-decoration: none; border-radius: var(--radius-sm); cursor: pointer; }
.preview-toc-item:hover { background: var(--bg-surface-hover); color: var(--text); }
.preview-toc-item.toc-l2 { padding-left: 20px; font-size: 12.5px; }
.preview-toc-item.toc-l3 { padding-left: 36px; font-size: 12px; color: var(--text-muted); }

/* ---- 置顶/标签徽章 ---- */
.badge-pin { background: var(--primary-light); color: var(--primary); font-size: 11px; }
.badge-tag { background: var(--bg-sunken); color: var(--text-muted); font-size: 11px; }
/* pinned 行/卡底色统一走品牌蓝（见 .file-row.is-pinned 左条+浅蓝底、.file-card.is-pinned 蓝 ring），杜绝橙蓝打架（R3） */
.file-card-pin { position: absolute; top: 6px; right: 6px; width: 14px; height: 14px; color: var(--primary); }
.file-card-pin svg { width: 14px; height: 14px; }
.file-card { position: relative; }
.breadcrumb-tag-filter { display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px; background: var(--primary-light); color: var(--primary); border-radius: var(--radius-sm); font-size: 12px; }
.breadcrumb-tag-filter a { color: var(--primary); text-decoration: none; font-size: 14px; }
.breadcrumb-tag-filter a:hover { opacity: .7; }

/* ---- 传输助手：发送状态指示（参考微信文件传输助手） ---- */
.transfer-status {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; align-self: center; width: 18px; height: 18px;
}
.transfer-status.sending {
  width: 14px; height: 14px;
  border: 2px solid var(--border); border-top-color: var(--text-muted);
  border-radius: 50%; animation: transfer-spin 0.8s linear infinite;
}
.transfer-status.failed {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--danger); color: #fff; cursor: pointer;
  font-size: 13px; font-weight: 700; line-height: 1;
  transition: transform .12s;
}
.transfer-status.failed::before { content: '!'; }
.transfer-status.failed:hover { transform: scale(1.12); }
@keyframes transfer-spin { to { transform: rotate(360deg); } }

/* ---- 传输助手：删除过渡态 ---- */
/* 消息整条半透明 + 不可点击，让用户明确"系统受理中"并防重复操作 */
.transfer-msg.is-deleting {
  opacity: .45;
  pointer-events: none;
  transform: translateX(6px);
  transition: opacity .18s ease, transform .18s ease;
}
/* 旋转进度圈：复用 sending 的 track 风格，但绝对定位于右上角，标题态可见 */
.transfer-msg.is-deleting::before {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--primary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: transfer-spin .8s linear infinite;
  z-index: 3;
  pointer-events: none;
}
/* 覆盖层：让整张图片/卡片在过渡态下都不能点，避免用户继续预览/下载 */
.transfer-msg.is-deleting .transfer-msg-body::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .0);
  pointer-events: none;
}
.transfer-del[disabled] {
  opacity: 0 !important;
  pointer-events: none;
  cursor: not-allowed;
}

/* ---- 下载授权弹窗 ---- */
.dl-auth-options { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.dl-auth-option { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s, background .15s; }
.dl-auth-option:hover { border-color: var(--border-light); background: var(--bg-surface-hover); }
.dl-auth-option input[type="radio"] { margin-top: 3px; accent-color: var(--primary); flex-shrink: 0; }
.dl-auth-option span { font-size: 14px; font-weight: 500; color: var(--text); }
.dl-auth-option small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.dl-auth-option:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }

/* ---- 下载激活横幅 ---- */
.download-active-banner { display: flex; align-items: center; gap: 10px; padding: 8px 20px; background: var(--warning); color: #fff; font-size: 13px; font-weight: 500; }
.download-active-banner .dl-banner-icon svg { width: 16px; height: 16px; fill: #fff; }
.download-active-banner .dl-banner-text { flex: 1; }
.download-active-banner .dl-banner-text strong { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.download-active-banner .dl-banner-close { background: rgba(255,255,255,0.2); border: none; color: #fff; font-size: 12px; padding: 4px 12px; border-radius: var(--radius-sm); cursor: pointer; transition: background .15s; }
.download-active-banner .dl-banner-close:hover { background: rgba(255,255,255,0.3); }

/* ---- 下载历史列表 ---- */
.dl-history-section { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 16px; }
.dl-history-title { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 10px; }
.dl-history-list { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; }
.dl-history-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--bg-sunken); border-radius: var(--radius-sm); font-size: 13px; }
.dl-history-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70%; }
.dl-history-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.dl-history-empty { font-size: 13px; color: var(--text-muted); padding: 8px 0; }

/* ---- Sensitive data mask spans ---- */
.sx-mask {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  background: var(--bg-sunken);
  border-radius: 3px;
  padding: 0 3px;
  font-family: var(--font-mono);
  font-size: 0.92em;
  line-height: 1.4;
  vertical-align: baseline;
  white-space: nowrap;
}
.sx-mask-text {
  letter-spacing: 0.3px;
  color: var(--text-secondary);
}
.sx-mask.revealed {
  background: var(--bg-sunken);
}
.sx-mask.revealed .sx-mask-text {
  color: var(--text);
}
.sx-mask-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  margin-left: 1px;
  width: 16px;
  height: 16px;
  border-radius: 2px;
  transition: color .12s, background .12s;
  flex-shrink: 0;
}
.sx-mask-toggle:hover {
  color: var(--primary);
  background: var(--primary-light);
}
.sx-mask-toggle:active {
  transform: scale(0.92);
}
.sx-mask-toggle:disabled {
  opacity: 0.5;
  cursor: wait;
}
.sx-mask-toggle svg {
  width: 12px;
  height: 12px;
}
/* Mask spans inside tool result <pre> blocks */
.tool-result .sx-mask,
.tool-args .sx-mask {
  font-size: 11px;
}
.tool-result .sx-mask-toggle,
.tool-args .sx-mask-toggle {
  width: 14px;
  height: 14px;
}
.tool-result .sx-mask-toggle svg,
.tool-args .sx-mask-toggle svg {
  width: 10px;
  height: 10px;
}

/* ============ Command Palette (Cmd+K) ============ */
.cmd-overlay {
  position: fixed; inset: 0; background: rgba(15, 18, 24, 0.45); z-index: 10000;
  display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh;
  backdrop-filter: blur(2px);
}
.cmd-palette {
  width: 560px; max-width: 90vw; background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 12px; box-shadow: 0 20px 60px rgba(15, 18, 24, 0.25);
  overflow: hidden;
}
.cmd-input-wrap {
  display: flex; align-items: center; gap: 10px; padding: 16px 20px;
  border-bottom: 1px solid var(--border, #eee);
}
.cmd-input-wrap svg { width: 18px; height: 18px; color: var(--text-muted, #999); flex-shrink: 0; }
.cmd-input {
  flex: 1; border: none; outline: none; font-size: 16px; background: transparent;
  color: var(--text, #333); font-family: inherit;
}
.cmd-hint { font-size: 11px; color: var(--text-muted, #aaa); white-space: nowrap; }
.cmd-results { max-height: 400px; overflow-y: auto; padding: 6px; }
.cmd-empty { text-align: center; padding: 28px; color: var(--text-muted, #999); font-size: 13px; }
.cmd-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-radius: 8px; cursor: pointer; transition: background 0.1s;
}
.cmd-item.is-selected { background: var(--primary-lighter); }
.cmd-item-icon { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--text-muted, #888); }
.cmd-item-icon svg { width: 18px; height: 18px; }
.cmd-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cmd-item-name { font-size: 14px; color: var(--text, #333); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-item-detail { font-size: 12px; color: var(--text-muted, #999); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-item-score { margin-left: auto; padding-left: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); flex-shrink: 0; align-self: center; }
.cmd-group-label {
  padding: 9px 14px 4px; font-size: 11px; font-weight: 600;
  color: var(--text-muted); letter-spacing: 0.05em; text-transform: uppercase;
}
.cmd-group-label:not(:first-child) { border-top: 1px solid var(--border-light); margin-top: 5px; padding-top: 11px; }
.cmd-footer {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 14px; border-top: 1px solid var(--border-light);
  font-size: 11px; color: var(--text-muted); background: var(--bg-sunken);
}
.cmd-footer kbd {
  font-family: var(--font-mono); font-size: 10px; padding: 1px 5px; margin-left: 6px;
  border-radius: 3px; border: 1px solid var(--border); background: var(--bg-surface);
  color: var(--text-secondary);
}
.cmd-footer-sep { width: 1px; height: 12px; background: var(--border); margin: 0 6px; }

/* ============ Wikilinks ============ */
.wikilink {
  color: var(--primary); text-decoration: none;
  border-bottom: 1px solid rgba(51, 112, 255, 0.35); cursor: pointer;
}
.wikilink:hover { background: var(--primary-lighter); border-radius: 2px; }

/* ============ Backlinks ============ */
.backlinks-section { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border, #eee); }
.backlinks-title { font-size: 14px; font-weight: 600; color: var(--text-secondary, #666); margin-bottom: 10px; }
.backlinks-list { display: flex; flex-direction: column; gap: 6px; }
.backlink-item {
  padding: 8px 12px; border-radius: var(--radius-sm); background: var(--bg-sunken);
  cursor: pointer; transition: background 0.15s;
}
.backlink-item:hover { background: var(--primary-lighter); }
.backlink-name { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text, #333); }
.backlink-name svg { width: 14px; height: 14px; }
.backlink-snippet { display: block; font-size: 12px; color: var(--text-muted, #999); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-backlinks-row { display: flex; flex-direction: column; gap: 8px; padding: 10px 0 4px; border-top: 1px solid var(--border-light); }
.note-backlinks-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.note-backlinks-label svg { width: 14px; height: 14px; }
.note-backlinks-list { display: flex; flex-direction: column; gap: 6px; }

/* ============ PII before/after 对比面板（settings 安全 tab） ============ */
.sx-compare { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.sx-compare-cap { display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-size: 13px; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--border-light); background: var(--bg-sunken); }
.sx-compare-cap svg { width: 16px; height: 16px; color: var(--primary); flex-shrink: 0; }
.sx-compare-panes { display: grid; grid-template-columns: 1fr 40px 1fr; }
.sx-pane { padding: 16px; }
.sx-pane + .sx-pane { border-left: 1px solid var(--border-light); }
.sx-pane-tag { display: inline-block; font-size: 11px; font-weight: 600; color: var(--text-muted); margin-bottom: 12px; letter-spacing: 0.04em; }
.sx-pane-list { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 13px; line-height: 1.5; }
.sx-pane-list li { display: flex; gap: 8px; }
.sx-pane-key { color: var(--text-muted); min-width: 3.5em; }
.sx-raw { font-family: var(--font-mono); color: var(--text); }
.sx-redact { font-family: var(--font-mono); color: var(--text-secondary); background: var(--bg-sunken); padding: 1px 6px; border-radius: 4px; }
.sx-compare-arrow { display: flex; align-items: center; justify-content: center; color: var(--text-muted); border-left: 1px solid var(--border-light); border-right: 1px solid var(--border-light); }
.sx-compare-arrow svg { width: 18px; height: 18px; }
@media (max-width: 900px) { .sx-compare-panes { grid-template-columns: 1fr; } .sx-compare-arrow { transform: rotate(90deg); border-left: none; border-right: none; border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); padding: 4px 0; } .sx-pane + .sx-pane { border-left: none; } }

/* ============ 档案室分组侧栏 ============ */
.files-body { display: flex; gap: 16px; align-items: flex-start; }
.files-groups { width: 220px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; padding: 12px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); position: sticky; top: 8px; box-shadow: var(--shadow-xs); }
.files-main { flex: 1; min-width: 0; }
.group-item-h { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; padding: 6px 10px 8px; }
.group-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: none; background: none; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-secondary); cursor: pointer; transition: background .15s, color .15s; text-align: left; font-family: inherit; }
.group-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.group-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-count { font-size: 11px; color: var(--text-muted); }
.group-item:hover { background: var(--bg-surface-hover); }
.group-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.group-item.active .group-count { color: var(--primary); }

/* 档案室标题行 + 新建分组按钮：补全布局与 svg 尺寸约束
   （修复：此前这两个 class 无任何规则，svg 按 viewBox 撑到 ~190px，把侧栏图标和按钮撑成巨型） */
.files-groups-hd { display: flex; align-items: center; gap: 8px; padding: 6px 10px 8px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.files-groups-hd svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-muted); }
.group-item-cta { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 6px; padding: 9px 10px; border: 1px dashed var(--border-strong); background: none; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-secondary); cursor: pointer; transition: background .15s, border-color .15s, color .15s; font-family: inherit; }
.group-item-cta:hover { background: var(--bg-surface-hover); border-color: var(--primary); color: var(--primary); }
.group-item-cta svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ---- 搜索结果卡片（对齐 landing figure 的语义检索碎片）---- */
.search-results { display: flex; flex-direction: column; gap: 8px; }
.search-results-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 60px 20px; color: var(--text-muted); }
.search-results-empty .empty-title { font-size: 15px; }
.search-result { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color .15s, box-shadow .15s, transform .1s; cursor: pointer; }
.search-result:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.search-result:active { transform: translateY(1px); }
.search-result:focus-visible { outline: 2px solid var(--primary-ring); outline-offset: 1px; border-color: var(--primary); }
.search-result-icon { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; display: inline-flex; }
.search-result-icon svg { width: 20px; height: 20px; }
.search-result-main { flex: 1; min-width: 0; }
.search-result-name { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-snippet { font-size: 13px; color: var(--text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-result-snippet mark.search-hit { background: var(--primary-light); color: var(--primary); border-radius: 2px; padding: 0 2px; font-weight: 600; }
.search-result-score { font-family: var(--font-mono); font-size: 12px; color: var(--primary); flex-shrink: 0; align-self: center; padding: 2px 9px; background: var(--primary-light); border-radius: var(--radius-pill); }

/* ---- AI 回答文件来源 chip（对齐 landing figure 的 sx-mockup-chip 药丸）---- */
.chat-cite-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chat-cite-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--bg-surface); border: 1px solid var(--border);
  font-family: inherit; font-size: 12px; color: var(--text-secondary);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.chat-cite-chip:hover { border-color: var(--primary); background: var(--primary-lighter); }
.chat-cite-chip svg { width: 13px; height: 13px; color: var(--primary); flex-shrink: 0; }
.chat-cite-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Search Result Meta (date · size) ---- */
.search-result-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ---- Search Sort Toggle ---- */
.search-sort-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px; border-radius: var(--radius-sm);
  background: transparent; border: none;
  font-size: 12px; color: var(--text-muted); cursor: pointer;
  font-family: var(--font-mono);
  transition: background .15s, color .15s;
}
.search-sort-toggle:hover { background: var(--bg-surface-hover); color: var(--text); }
.search-sort-toggle.is-active { color: var(--primary); background: var(--primary-bg); }
@media (max-width: 900px) { .files-groups { display: none; } .files-body { flex-direction: column; } }

/* ============ Shortcut Help ============ */
.shortcut-help-body { max-height: 60vh; overflow-y: auto; }
.shortcut-group { margin-bottom: 20px; }
.shortcut-group-title { font-size: 12px; font-weight: 600; color: var(--text-muted, #999); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.shortcut-row { display: flex; align-items: center; gap: 14px; padding: 5px 0; }
.shortcut-key {
  font-family: ui-monospace, 'SF Mono', monospace; font-size: 12px;
  padding: 3px 8px; border-radius: 4px; background: var(--bg-sunken);
  border: 1px solid var(--border, #e0e0e0); color: var(--text-secondary, #555);
  min-width: 120px; text-align: center; white-space: nowrap;
}
.shortcut-desc { font-size: 13px; color: var(--text, #333); }
.shortcut-note { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-light); font-size: 12px; color: var(--text-muted); }

/* ============ 回收站专业化 ============ */

/* 滚动体：仿 .files-body，让长表格在 #main-content(overflow:hidden) 内可滚动 */
.trash-body { flex: 1 1 auto; overflow-y: auto; padding: 18px 24px 32px; min-height: 0; }

/* 横向滚动兜底：窄屏下 7 列表格不击穿视口，改为横滚 */
.table-scroll { overflow-x: auto; overflow-y: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.table-scroll > .data-table { border: none; border-radius: 0; }

/* ---- 保留期横幅 ---- */
.trash-banner {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 12px;
  padding: 10px 14px;
  background: var(--warning-light);
  border: 1px solid rgba(255, 125, 0, 0.25);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
}
.trash-banner-icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255, 125, 0, 0.12);
  color: var(--warning);
}
.trash-banner-icon svg { width: 16px; height: 16px; }
.trash-banner-text { flex: 1; min-width: 0; line-height: 1.5; }
.trash-banner strong { color: var(--text); }

/* ---- 空态 ---- */
.trash-empty-art {
  width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--warning-light);
  color: var(--warning);
}
.trash-empty-art svg { width: 36px; height: 36px; }
.badge-lock {
  background: rgba(51, 112, 255, 0.10);
  color: var(--primary);
  font-size: 11px;
  display: inline-flex; align-items: center; gap: 3px;
}
.badge-lock svg { width: 10px; height: 10px; }

/* 选中高亮：作用在 td（与 .data-table tr:hover td 同模式），避免被单元格背景盖住 */
.trash-row.is-selected > td { background: var(--primary-light) !important; }
.trash-row.is-selected:hover > td { background: var(--primary-light) !important; }

/* 回收站表格固定列宽 */
.trash-table { table-layout: fixed; width: 100%; min-width: 960px; }
.trash-table .col-check { width: 36px; }
.trash-table .col-name { width: 220px; }
.trash-table .col-path { width: 16%; }
.trash-table .col-size { width: 70px; }
.trash-table .col-deleted { width: 150px; }
.trash-table .col-remaining { width: 80px; }
.trash-table .col-actions { width: 260px; }
.trash-table .th-check { text-align: center; }
/* 文件名列最小宽度：作用在 th/td（table-layout:fixed 下 col 的 min-width 不被尊重） */
.trash-table th:nth-child(2), .trash-table td:nth-child(2) { min-width: 220px; }
.trash-table td:last-child { text-align: right; display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
/* 回收站窄屏响应式（对齐文件库 .file-row 的列隐藏，杜绝横滚把「恢复/删除」操作挤出可视区）*/
@media (max-width: 900px) {
  .trash-table { min-width: 0; }   /* 否则固定 960 仍会横滚，把操作列挤出可视区 */
  .trash-table .col-path, .trash-table .col-remaining,
  .trash-table th:nth-child(3), .trash-table td:nth-child(3),
  .trash-table th:nth-child(6), .trash-table td:nth-child(6) { display: none; }
}
@media (max-width: 600px) {
  .trash-table .col-deleted, .trash-table th:nth-child(5), .trash-table td:nth-child(5) { display: none; }
}
/* 回收站表格横向滚动容器：填满宽度，表格超宽时滚动 */
.table-scroll { width: 100%; overflow-x: auto; }

.trash-preview-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--warning-light);
  color: var(--warning);
}
.trash-preview-badge svg { width: 11px; height: 11px; }
.confirm-input { margin-bottom: 16px; }
.confirm-input-hint code { user-select: all; }
.btn.is-active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }

/* ============================================================
   Notes v2: Bento Grid · Immersive Editor · Aligned with Landing
   ============================================================ */

/* ---- Notes Grid（§4 列表骨架）---- */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.notes-grid.list { grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 1440px) { .notes-grid { gap: 16px; } }

/* ---- Note Card（§5.1 样板组件：圆角10/内边距16/无让位补丁/无 meta 分隔线）---- */
.note-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  min-height: 156px;
  outline: none;
  transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease), background var(--dur-base) var(--ease);
}
.note-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.note-card:hover:active { transform: translateY(-1px) scale(0.99); }
.note-card:focus-visible { outline: 2px solid var(--primary-ring); outline-offset: 2px; }
.note-card.selected { border-color: var(--primary); background: var(--primary-lighter); } /* 多选态（随多选功能启用） */

.note-card-title {
  font-size: 15px; font-weight: 600; line-height: 1.45; letter-spacing: -0.01em; color: var(--text);
  margin: 0; padding-right: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.note-card-pin-g { width: 14px; height: 14px; color: var(--primary); display: inline-block; vertical-align: -2px; margin-right: 5px; flex: none; }
.note-card-excerpt {
  font-size: 13px; line-height: 20px; color: var(--text-secondary); margin: 8px 0 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.note-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.note-card-tag {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px;
  border-radius: var(--radius-pill); background: var(--primary-light); color: var(--primary);
  font-size: 11px; font-weight: 500; line-height: 1;
}
.note-card-tag svg { width: 10px; height: 10px; }
.note-card-tag.ai-tag { background: var(--primary-lighter); border: 1px dashed var(--primary-ring); } /* AI 标签：虚线区分 */
.note-card-tag.more { background: var(--bg-sunken); color: var(--text-muted); }
.note-card-meta {
  display: flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 12px;
  font-size: 12px; color: var(--text-muted); line-height: 16px; /* sans，永不 mono */
}
.note-card-meta svg { width: 12px; height: 12px; flex: none; }
.note-card-meta .mdot { opacity: .6; }

/* 悬停操作条：实底浮层（令牌色，无字面 rgba；深色自动跟随 --bg-surface）*/
.note-card-actions {
  position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; padding: 2px;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(-2px);
  transition: opacity var(--dur-fast), transform var(--dur-fast); z-index: 2;
}
.note-card:hover .note-card-actions, .note-card:focus-within .note-card-actions { opacity: 1; pointer-events: auto; transform: none; }
.note-card-action {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border: none; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary);
  cursor: pointer; transition: background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}
.note-card-action:hover { background: var(--bg-surface-hover); color: var(--text); }
.note-card-action:active { transform: scale(0.92); }
.note-card-action.danger:hover { background: var(--danger-light); color: var(--danger); }
.note-card-action:focus-visible { outline: 2px solid var(--primary-ring); outline-offset: 1px; }
.note-card-action svg { width: 15px; height: 15px; }

/* 批量选择（与文件库 .batch-bar / .is-selected 统一）*/
.note-card.selecting { padding-left: 40px; }
.note-card.is-selected { background: var(--primary-light); border-color: var(--primary); }
.note-card.is-selected:hover { background: var(--primary-light); }
.note-check { position: absolute; top: 14px; left: 12px; width: 18px; height: 18px; margin: 0; accent-color: var(--primary); cursor: pointer; z-index: 3; }
.note-card.selecting .note-card-actions { display: none; }

/* 列表视图（§5.5 视图切换）*/
.notes-grid.list .note-card { flex-direction: row; align-items: center; gap: 16px; padding: 12px 16px; min-height: 0; }
.notes-grid.list .note-card-title { flex: none; width: 230px; -webkit-line-clamp: 1; }
.notes-grid.list .note-card-excerpt { flex: 1; -webkit-line-clamp: 1; margin: 0; }
.notes-grid.list .note-card-tags { display: none; }
.notes-grid.list .note-card-meta { margin: 0; padding: 0; flex: none; }
@media (max-width: 760px) { .notes-grid.list .note-card { flex-wrap: wrap; } .notes-grid.list .note-card-title { width: 100%; } }
@media (hover: none) { .note-card-actions { opacity: 1; pointer-events: auto; transform: none; box-shadow: none; border-color: transparent; background: transparent; } }

/* ---- 笔记页头控件 + 吸顶筛选栏（§4 / §5.2-5.5）---- */
.notes-head .files-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notes-search { position: relative; width: 220px; transition: width 180ms var(--ease); }
.notes-search:focus-within { width: 300px; }
.notes-search > svg { position: absolute; left: 10px; top: 8px; width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.notes-search input {
  width: 100%; height: 32px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface);
  padding: 0 30px 0 32px; font-family: inherit; font-size: 13px; color: var(--text); outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.notes-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.notes-search input::placeholder { color: var(--text-muted); }
.notes-search-clr {
  position: absolute; right: 4px; top: 4px; width: 24px; height: 24px; display: none;
  border: none; background: transparent; color: var(--text-muted); cursor: pointer; border-radius: var(--radius-sm);
  align-items: center; justify-content: center; transition: background var(--dur-fast), color var(--dur-fast);
}
.notes-search-clr:hover { background: var(--bg-surface-hover); color: var(--text); }
.notes-search-clr svg { width: 14px; height: 14px; }
.notes-search.has .notes-search-clr { display: inline-flex; }
.notes-seg { display: inline-flex; background: var(--bg-sunken); border-radius: var(--radius); padding: 2px; gap: 2px; }
.notes-seg button { width: 28px; height: 24px; border: none; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all var(--dur-fast); }
.notes-seg button svg { width: 14px; height: 14px; }
.notes-seg button.on { background: var(--bg-surface); color: var(--text); box-shadow: var(--shadow-xs); }
.notes-sort { position: relative; display: inline-flex; }
.notes-menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 168px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px; z-index: 40;
  opacity: 0; transform: translateY(-4px) scale(0.98); transform-origin: top right; pointer-events: none;
  transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}
.notes-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.notes-menu-i { display: flex; width: 100%; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border: none; border-radius: var(--radius-sm); background: none; font-family: inherit; font-size: 13px; color: var(--text); cursor: pointer; text-align: left; transition: background var(--dur-fast); }
.notes-menu-i svg { width: 14px; height: 14px; color: var(--text-muted); }
.notes-menu-i:hover { background: var(--bg-surface-hover); }
.notes-menu-i .ck { color: var(--primary); opacity: 0; }
.notes-menu-i.on .ck { opacity: 1; }
.notes-toolbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 16px; padding: 8px 0; background: var(--bg); }
.notes-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.note-chip {
  height: 28px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--radius-pill);
  background: var(--bg-sunken); color: var(--text-secondary); font-family: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all var(--dur-fast);
}
.note-chip:hover { background: var(--bg-surface-active); color: var(--text); }
.note-chip:focus-visible { outline: 2px solid var(--primary-ring); outline-offset: 2px; }
.note-chip .n { font-size: 11px; opacity: .7; }
.note-chip.on { background: var(--primary-light); color: var(--primary); border-color: var(--primary-ring); font-weight: 600; }
.note-chip.on::before { content: "✓"; font-size: 11px; }
.notes-toolbar-r { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.notes-filtered { font-size: 12px; color: var(--text-muted); }
.notes-clearlink { border: none; background: none; font-family: inherit; font-size: 12px; color: var(--text-muted); cursor: pointer; padding: 4px 6px; border-radius: 4px; transition: color var(--dur-fast); }
.notes-clearlink:hover { color: var(--primary); }
.notes-section-h { display: flex; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); margin: 0 0 12px; }
.notes-section-h .cnt { font-size: 11px; opacity: .8; }
.notes-grid + .notes-section-h { margin-top: 28px; }
@media (max-width: 640px) { .notes-search, .notes-search:focus-within { width: 100%; } .notes-head .files-controls { width: 100%; } }

/* ---- Notes: 加载骨架屏（对齐 note-card 结构，复用 shimmer 动画） ---- */
.notes-grid-skeleton {
  pointer-events: none;          /* 加载中禁止误触 */
}
.note-card-skeleton {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  min-height: 156px;             /* 与真实卡片高度相近，避免加载→数据切换跳动 */
}
.ncs-line {
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--border-light) 37%, var(--bg-elevated) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
.ncs-title { width: 70%; height: 14px; margin-bottom: 6px; }
.ncs-excerpt { width: 100%; margin-bottom: 6px; }
.ncs-excerpt.ncs-short { width: 55%; margin-bottom: 0; }
.ncs-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
}
.ncs-tag { width: 36px; height: 14px; border-radius: 999px; }
.ncs-meta-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bg-elevated); }
@media (prefers-reduced-motion: reduce) {
  .ncs-line { animation: none; }   /* 尊重无障碍设置，停止闪烁 */
}

/* ---- Notes: Empty State ---- */
.notes-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}

.notes-empty-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--primary-light);
  color: var(--primary);
  margin-bottom: 16px;
}

.notes-empty-icon svg {
  width: 28px;
  height: 28px;
}

.notes-empty-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 6px;
}

.notes-empty-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 380px;
}
/* 空状态行动按钮 / 加载失败错误态（§5.6 三态：空库 / 筛选无果 / 失败 互不通用） */
.notes-empty-cta { margin-top: 20px; }
.notes-empty--error .notes-empty-icon,
.notes-empty-icon--error { background: var(--danger-light); color: var(--danger); }

/* ---- Notes Editor v2: Immersive Fullscreen ---- */
.note-editor-modal {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  border-radius: 0;
  border: none;
  box-shadow: none;
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: var(--bg);
}

/* Editor Top Bar */
.note-editor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.note-editor-top-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 面包屑（替代旧 uppercase 标题，§5.7）*/
.ed-crumb { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--text-muted); }
.ed-crumb-sep { opacity: .6; }
.ed-crumb-title { font-size: 14px; font-weight: 600; color: var(--text); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42vw; letter-spacing: -0.01em; }

.note-editor-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
/* 保存状态徽标四态（§5.7：saved / saving / unsaved / failed）*/
.save-badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 500; border: 1px solid var(--border); color: var(--text-muted); background: var(--bg-surface); transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast); }
.save-badge svg { width: 12px; height: 12px; }
.save-badge .sb-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warning); }
.save-badge .sb-spin { width: 11px; height: 11px; border: 2px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: rot 0.8s linear infinite; }
.save-badge.warn { background: var(--warning-light); border-color: transparent; color: var(--warning); }
.save-badge.dngr { background: var(--danger-light); border-color: transparent; color: var(--danger); cursor: pointer; }
@keyframes rot { to { transform: rotate(360deg); } }
/* 溢出菜单：删除等破坏性操作降级于此（§5.7，危险色仅菜单内悬停出现）*/
.ed-more { position: relative; display: inline-flex; }
.ed-more-menu { position: absolute; top: calc(100% + 6px); right: 0; min-width: 176px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px; z-index: 50; opacity: 0; transform: translateY(-4px) scale(0.98); transform-origin: top right; pointer-events: none; transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease); }
.ed-more-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.ed-more-i { display: flex; width: 100%; align-items: center; gap: 9px; height: 34px; padding: 0 11px; border: none; border-radius: var(--radius-sm); background: none; font-family: inherit; font-size: 13px; color: var(--text); cursor: pointer; text-align: left; transition: background var(--dur-fast), color var(--dur-fast); }
.ed-more-i svg { width: 15px; height: 15px; color: var(--text-muted); transition: color var(--dur-fast); }
.ed-more-i:hover { background: var(--bg-surface-hover); }
.ed-more-i.is-active { color: var(--primary); }
.ed-more-i.is-active svg { color: var(--primary); }
.ed-more-i.danger:hover { background: var(--danger-light); color: var(--danger); }
.ed-more-i.danger:hover svg { color: var(--danger); }
.ed-more-sep { height: 1px; background: var(--border-light); margin: 4px 0; }

/* Editor Toolbar */
.note-toolbar {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 4px 10px;
  scrollbar-width: none;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.note-toolbar::-webkit-scrollbar { display: none; }

.tb-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 5px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}

.tb-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text);
}

.tb-btn.is-active {
  background: var(--primary-light);
  color: var(--primary);
}

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

.tb-sep {
  width: 1px;
  height: 16px;
  background: var(--border-light);
  margin: 0 4px;
  flex-shrink: 0;
}

/* Editor Split Layout */
.note-editor-body {
  display: flex;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.note-editor-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.note-editor-split {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.note-editor-pane,
.note-preview-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.note-preview-pane {
  border-left: 1px solid var(--border);
  background: var(--bg);
  padding: 32px 32px 48px;
}

.note-editor-pane {
  background: var(--bg-surface);
}

.note-content-input {
  flex: 1;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  padding: 32px 32px 48px;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  background: transparent;
  color: var(--text);
  margin: 0 auto;
  max-width: 720px;
}

.note-content-input::placeholder {
  color: var(--text-muted);
}

/* Markdown Preview Container */
.note-editor-split .markdown-body {
  width: 100%;
  max-width: 720px;
  background: transparent;
  padding: 0;
  margin: 0 auto;
  box-shadow: none;
  min-height: auto;
}

.nsb-item {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Editor Bottom Bar (Meta + Actions) */
.note-editor-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.note-editor-extras {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 单行页脚：左 = 标签 + 统计，右 = 视图/取消/保存（原状态栏已合并进来） */
.note-editor-footrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.note-foot-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.note-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.nsb-dot { color: var(--border-strong); font-size: 11px; }

.note-tags-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.note-tags-row > svg {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.note-tags-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.note-tags-input {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  padding: 0;
  background: transparent;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.note-tags-input:focus-within .note-tag-field::placeholder {
  color: var(--text-secondary);
}

.note-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.3;
}

/* C3: 已删除死规则 .note-tag-chip.ai-tag —— renderTags 只产出 .note-tag-chip（无 ai-tag 类），
   卡片网格的 ai-tag 用的是 .note-card-tag.ai-tag（见上），二者不同。 */

.note-tag-remove {
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.6;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.note-tag-remove:hover {
  opacity: 1;
  background: var(--bg-surface-hover);
}

.note-tag-field {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  min-width: 120px;
  flex: 1;
  font-family: var(--font-sans);
  color: var(--text);
}

/* ---- AI 建议标签行 ---- */
.note-tag-suggest-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 2px 0;
}
.note-tag-suggest-row > svg {
  width: 15px;
  height: 15px;
  color: var(--success);
  flex-shrink: 0;
}
.note-tag-suggest-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--success);
  flex-shrink: 0;
}
.note-tag-suggest-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}
.note-tag-suggest-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px dashed color-mix(in srgb, var(--success) 45%, transparent);
  background: var(--success-light);
  color: var(--success);
  font-size: 11.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--dur-base), border-color var(--dur-base), transform var(--dur-fast);
}
.note-tag-suggest-chip:hover {
  background: color-mix(in srgb, var(--success) 16%, transparent);
  border-style: solid;
}
.note-tag-suggest-chip:active { transform: scale(0.96); }
.note-tag-suggest-chip::after {
  content: '+';
  font-weight: 600;
  opacity: 0.6;
}
.note-tag-suggest-act {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: background .15s;
}
.note-tag-suggest-act:hover { background: var(--primary-light); }
.note-tag-suggest-act.dismiss { color: var(--text-muted); }
.note-tag-suggest-act.dismiss:hover { background: var(--bg-surface-hover); }

.note-summary-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: var(--primary-light);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.note-summary-row > svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 1px;
}

.note-summary-text {
  flex: 1;
}

.note-backlinks-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0 2px;
  border-top: 1px solid var(--border-light);
}

.note-backlinks-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.note-backlinks-label svg {
  width: 14px;
  height: 14px;
}

.note-backlinks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.backlink-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid var(--border-light);
}

.backlink-item:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border);
}

.backlink-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.backlink-name svg {
  width: 14px;
  height: 14px;
  color: var(--primary);
}

.backlink-snippet {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-editor-bottom .modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.note-editor-bottom .modal-actions .btn {
  margin: 0;
}

/* View Mode Toggles（mode 类挂在 modal 上，可控制工具栏/状态栏等兄弟元素） */
.note-editor-modal.mode-edit .note-preview-pane { display: none; }
.note-editor-modal.mode-preview .note-editor-pane,
.note-editor-modal.mode-preview .note-toolbar { display: none; }
.note-editor-modal.mode-preview .note-preview-pane { border-left: none; }

/* Title Input */
.note-title-input {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 12px 22px 6px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  width: 100%;
  font-family: var(--font-sans);
}

.note-title-input::placeholder {
  font-weight: 500;
  color: var(--text-muted);
}

/* ---- 顶部图标按钮（关闭 / TOC / 置顶 / 导出） ---- */
.tb-icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: 1px solid var(--border);
  background: var(--bg-surface); color: var(--text-secondary);
  border-radius: 6px; cursor: pointer; transition: all .14s ease;
  flex-shrink: 0;
}
.tb-icon-btn:hover { background: var(--bg-surface-hover); color: var(--text); border-color: var(--border-light); }
.tb-icon-btn.is-active { background: var(--warning); color: #fff; border-color: var(--warning); }
.tb-icon-btn svg { width: 16px; height: 16px; }

.note-editor-top-actions .btn-sm { display: flex; align-items: center; gap: 5px; font-size: 13px; padding: 5px 12px; }
.note-editor-top-actions .btn-sm svg { width: 14px; height: 14px; }

/* ---- TOC 侧边栏 ---- */
.note-toc-pane {
  width: 220px; flex-shrink: 0; border-right: 1px solid var(--border);
  display: none; flex-direction: column; background: var(--bg-surface);
}
.note-editor-body.toc-visible .note-toc-pane { display: flex; }
.note-toc-header {
  padding: 10px 14px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.note-toc-list { flex: 1; overflow-y: auto; padding: 6px; }
.note-toc-empty { padding: 12px 14px; font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.note-toc-item {
  display: block; padding: 5px 10px; font-size: 13px; color: var(--text-secondary);
  text-decoration: none; border-radius: 4px; cursor: pointer; line-height: 1.4;
  transition: background .12s, color .12s; border-left: 2px solid transparent;
}
.note-toc-item:hover { background: var(--bg-surface-hover); color: var(--text); }
.note-toc-item.toc-l2 { padding-left: 22px; font-size: 12.5px; }
.note-toc-item.toc-l3 { padding-left: 34px; font-size: 12px; color: var(--text-muted); }

/* ---- Responsive Adjustments ---- */
@media (max-width: 900px) {
  .notes-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
  }
}

@media (max-width: 600px) {
  .notes-grid {
    grid-template-columns: 1fr;
  }

  .note-editor-modal .note-editor-split {
    flex-direction: column;
  }

  .note-editor-modal.mode-split .note-editor-split {
    flex-direction: column-reverse;
  }

  .note-editor-modal.mode-split .note-editor-pane,
  .note-editor-modal.mode-split .note-preview-pane {
    flex: none;
    height: 50%;
  }

  .note-preview-pane {
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .note-content-input,
  .note-preview-pane {
    padding: 20px 16px 32px;
  }

  .note-toc-pane { display: none !important; }
}

/* file-list-card / file-table 的 flex 列方向已上移至主样式块（R7：历史补丁已合并） */

/* ============ 敏感文件功能补全（alert-bar / is-sensitive / grid 操作药丸 / 侧栏敏感项） ============ */
/* 告警条（参考 .trash-banner 模式）*/
.alert-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 10px 14px; background: var(--warning-light); border: 1px solid rgba(255, 125, 0, 0.25); border-left: 3px solid var(--warning); border-radius: var(--radius-sm); font-size: 13px; color: var(--text-secondary); }
.alert-bar-icon { flex-shrink: 0; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; color: var(--warning); }
.alert-bar-icon svg { width: 16px; height: 16px; }
.alert-bar-text { flex: 1; min-width: 0; line-height: 1.5; }
.alert-bar-text b { color: var(--text); font-weight: 600; }
.alert-bar-text span { color: var(--text-muted); }
.alert-bar .btn-sm { flex-shrink: 0; }
.alert-bar-close { flex-shrink: 0; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; color: var(--text-muted); cursor: pointer; border-radius: var(--radius-sm); transition: background .12s, color .12s; }
.alert-bar-close:hover { background: rgba(255, 125, 0, 0.12); color: var(--warning); }
.alert-bar-close svg { width: 14px; height: 14px; }

/* 敏感文件行/卡：橙色左条 + 浅橙底（优先级高于 pinned；兑现告警条"左侧橙色竖线"文案）*/
.file-row.is-sensitive, .file-card.is-sensitive { box-shadow: inset 3px 0 0 var(--warning); }
.file-row.is-sensitive { background: var(--warning-light); }
.file-row.is-sensitive:hover { background: rgba(255, 125, 0, 0.12); }
.file-card.is-sensitive { border-color: rgba(255, 125, 0, 0.4); }

/* grid 卡片 hover 操作药丸（参考 .note-card-action）：默认隐藏、hover 显示，删除按钮不常驻 */
.file-card-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; padding: 2px; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(4px); border-radius: var(--radius-sm); box-shadow: var(--shadow-xs); opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 2; }
.file-card:hover .file-card-actions, .file-card:focus-within .file-card-actions { opacity: 1; pointer-events: auto; }
.file-card-action { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; color: var(--text-secondary); cursor: pointer; border-radius: var(--radius-sm); transition: background .12s, color .12s; }
.file-card-action:hover { background: var(--bg-surface-hover); color: var(--text); }
.file-card-action.danger:hover { background: var(--danger-light); color: var(--danger); }
.file-card-action svg { width: 15px; height: 15px; }
html.dark .file-card-actions { background: rgba(40, 44, 52, 0.9); }

/* 侧栏敏感分组项 + 分隔线 */
.group-divider { height: 1px; background: var(--border-light); margin: 8px 4px; }
.group-item--sensitive { color: var(--warning); }
.group-item--sensitive:hover { background: var(--warning-light); color: var(--warning); }
.group-item--sensitive.active { background: var(--warning-light); color: var(--warning); font-weight: 600; }
