﻿/* ============================================================
   栖屿笔记 — 暖纸色书写空间（系统字体，零外部依赖）
   ============================================================ */

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

:root {
--bg: #f3f2ed;
  --panel: #fffefa;
  --surface: #f8f7f3;
  --border: #e6e5dd;
  --text: #2c3630;
  --text-2: #737c73;
  --text-3: #8a9289;
  --accent: #416653;
  --accent-dark: #2c4e3c;
  --accent-soft: #e7eee7;
  --brand-soft: var(--accent-soft);
  --line: var(--border);
  --danger: #b95750;
  --warning: #a47732;
  --success: #49745a;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(43, 54, 45, .08);
  --sidebar-w: 300px;
  --topbar-h: 74px;
  --footer-h: 32px;
  --editor-font-size: 16px;
  --editor-line-height: 1.8;
  --blank-height: 12px;
}

html, body { height: 100%; }

body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

input, textarea, select, button { font-family: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d4d4d9; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #bfbfc6; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 整体布局 ============ */
#app {
display: flex;
  height: 100vh;
  height: 100dvh;
  padding-bottom: var(--footer-h);
  overflow: hidden;
}

/* ============ ICP 备案号 ============ */
.site-footer {
position: fixed;
  inset: auto 0 0;
  z-index: 70;
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  letter-spacing: .15px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }

#main {
flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
}

/* ============ 按钮 ============ */
.btn {
display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover:not(:disabled) { background: var(--bg); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--accent-dark); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-ghost { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.danger-ghost:hover:not(:disabled) { background: #fdecec; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.icon-btn {
display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  font-size: 15px;
  border-radius: 8px;
  color: var(--text-2);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
/* GitHub 开源链接（Q1）：默认松绿品牌色，悬停加深 + 浅绿底 */
.icon-btn.accent { color: var(--accent); }
.icon-btn.accent:hover { background: var(--accent-soft); color: var(--accent-dark); }

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 12.5px;
  padding: 2px;
}
.link-btn:hover { text-decoration: underline; }

/* ============ 侧边栏 ============ */
#sidebar {
width: clamp(248px, var(--sidebar-w), 420px);
  min-width: clamp(248px, var(--sidebar-w), 420px);
  height: 100%;
  min-height: 0;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: margin-left .18s ease, width .18s ease, min-width .18s ease;
}
/* 收起状态：左侧滑出（配合 #app 的 flex 布局，main 自动占满）
   仅桌面端生效；移动端抽屉模式不受影响 */
@media (min-width: 769px) {
  #app.sidebar-collapsed #sidebar {
    margin-left: calc(-1 * clamp(248px, var(--sidebar-w), 420px));
  }
  /* 收起后：顶栏菜单按钮作为展开入口 */
  #app.sidebar-collapsed .menu-btn { display: inline-flex; }
  /* 收起后隐藏调宽条（避免视口边缘残留可交互条） */
  #app.sidebar-collapsed .sidebar-resizer { display: none; }
}
/* 拖拽调宽期间关闭过渡（避免边缘追不上光标） */
body.sidebar-resizing #sidebar { transition: none; }

.sidebar-header {
display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 24px 18px 20px 22px;
}
.logo {
display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: .8px;
}
.sidebar-collapse-btn { flex-shrink: 0; }

/* 拖拽调宽条（桌面端显示） */
.sidebar-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 20;
  background: transparent;
  transition: background .15s;
}
.sidebar-resizer:hover,
.sidebar-resizer.resizing { background: rgba(65, 102, 83, .30); }
body.sidebar-resizing { cursor: col-resize; user-select: none; }

/* 排序栏 */
.sort-bar {
display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.sort-label { font-size: 11px; color: var(--text-2); white-space: nowrap; }
.sort-select {
max-width: 140px;
  min-width: 0;
  min-height: 30px;
  padding: 3px 2px 3px 6px;
  font-size: 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.sort-select:focus-visible { border-color: var(--accent); }

/* 自定义排序拖拽 */
.note-item[draggable="true"] { cursor: grab; }
.note-item[draggable="true"]:active { cursor: grabbing; }
.note-item.drag-src { opacity: .45; }
.note-item.drag-over { box-shadow: 0 -2px 0 0 var(--accent); }

.search-wrap {
position: relative;
  margin: 0 18px 14px;
}
.search-wrap input {
width: 100%;
  min-width: 0;
  height: 38px;
  padding: 8px 12px 8px 35px;
  border: 1px solid #e2e4da;
  border-radius: 8px;
  background: rgba(255, 254, 250, .72);
  color: var(--text);
  font-size: 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(65, 102, 83, .13); }

.tag-section {
flex-shrink: 0;
  padding: 0 20px 10px;
}
.tag-title {
font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.tag-title::before {
content: none;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  min-height: 27px;
  padding: 3px 9px;
  font-size: 11px;
  color: var(--text-2);
  transition: background .15s, color .15s, border-color .15s;
}
.tag-chip:hover { background: var(--accent-soft); border-color: #b8c9bc; color: var(--accent); }
.tag-chip:active { transform: scale(.95); }
.tag-chip.active {
background: var(--accent-soft);
  border-color: #bdcebf;
  color: var(--accent-dark);
  font-weight: 600;
}
.tag-count { opacity: .72; font-size: 10.5px; margin-left: 2px; }

/* 笔记列表 */
.note-list {
flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 12px 12px;
}
.list-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.8;
}
.list-empty.error { color: var(--danger); cursor: pointer; }

.note-item {
display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 13px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  margin-bottom: 4px;
}
.note-item:hover { background: #eaece4; }
.note-item.active {
background: var(--accent-soft);
  border-color: #d8e2d5;
}
.note-item-main { flex: 1; min-width: 0; }
.note-item-title {
font-size: 13px;
  font-weight: 600;
  line-height: 1.65;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.note-item.active .note-item-title { color: var(--accent-dark); }
.untitled { color: var(--text-2); font-style: italic; font-weight: 400; }
.note-item-meta {
font-size: 10.5px;
  color: var(--text-3);
  margin-top: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.note-del {
display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 26px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity .15s, background .15s;
}
.note-item:hover .note-del { opacity: .65; }
.note-del:hover { opacity: 1 !important; background: #e0e4db; }
@media (hover: none) { .note-del { opacity: .65; } }

.new-note-btn {
width: 100%; min-height: 41px; justify-content: flex-start; padding-left: 14px; margin: 0;
}

/* 骨架屏 */
.skeleton {
  height: 48px;
  border-radius: 8px;
  margin: 6px 4px;
  background: linear-gradient(90deg, #ececf0 25%, #f7f7f9 50%, #ececf0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============ 顶栏 ============ */
.topbar {
height: var(--topbar-h);
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 26px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.menu-btn { display: none; }
.topbar-actions {
margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0;
}

.save-status {
font-size: 11px; color: var(--text-3); flex-shrink: 0; margin-left: 8px;
}
.save-status.saving { color: var(--text-2); }
.save-status.dirty { color: var(--warning); }
.save-status.saved { color: var(--success); }

/* ============ 主区加载 / 空态 ============ */
.main-loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 13px;
}

.empty-state {
flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-2);
  text-align: center;
  padding: 32px;
}
.empty-icon {
display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 8px;
  border: 1px solid #dce5d9;
  border-radius: 24px;
  background: var(--accent-soft);
  color: var(--accent);
}
.empty-state h2 {
font-size: 23px; font-weight: 600; letter-spacing: .5px; color: var(--text);
}
.empty-state p {
font-size: 13px; line-height: 1.9; max-width: 340px;
}
.empty-state .btn { margin-top: 10px; }

/* ============ 编辑器 ============ */
.editor-view {
flex: 1;
  min-width: 0;
  min-height: 0;
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
  padding: 32px 36px 0;
  display: flex;
  flex-direction: column;
}

.title-input {
flex-shrink: 0;
  width: 100%;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 30px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -.5px;
  padding: 4px 0 12px;
}
.title-input::placeholder { color: #afb5aa; font-weight: 500; }

.mode-toggle {
display: inline-flex;
  align-self: center;
  flex-shrink: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 2px;
  margin: 0;
}
.mode-btn {
border: none;
  background: transparent;
  min-height: 29px;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.mode-btn.active {
background: var(--panel); color: var(--accent-dark); box-shadow: 0 1px 3px rgba(37, 53, 42, .08);
}

.editor-area {
flex: 1; min-height: 90px; display: flex; flex-direction: column; position: relative;
}

/* Markdown 工具栏（z-index 高于覆盖编辑的 textarea，保证覆盖态下仍可点击） */
.md-toolbar {
position: relative;
  z-index: 6;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  gap: 2px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  user-select: none;
}
.md-group { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.md-sep {
width: 1px; height: 15px; background: var(--border); margin: 0 3px; flex-shrink: 0;
}
.md-btn {
display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 27px;
  height: 31px;
  padding: 0 5px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1;
  transition: background .15s, color .15s;
}
.md-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.md-btn.md-label-btn { font-size: 12px; font-weight: 700; letter-spacing: .2px; }
.md-btn:hover { background: var(--accent-soft); color: var(--text); }
.md-btn:active { background: #dce7dc; }
.md-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.md-btn:disabled { opacity: .4; cursor: not-allowed; }

.content-input {
flex: 1;
  min-height: 0;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--text);
  font-family: "SF Mono", Consolas, "Microsoft YaHei", monospace;
  font-size: calc(var(--editor-font-size) * .92);
  line-height: var(--editor-line-height);
  padding: 14px 3px 24px 0;
  scrollbar-gutter: stable;
}

/* 编辑模式（默认）：contenteditable 渲染编辑（Typora 式），textarea 隐藏 */
.editor-area:not(.source-mode) .content-input { display: none; }
.editor-area:not(.source-mode) .render-edit { display: block; }
/* 源码模式：显示 Markdown 原文，隐藏渲染编辑 */
.editor-area.source-mode .content-input { display: block; }
.editor-area.source-mode .render-edit { display: none; }

/* 渲染编辑区（contenteditable）：所见即光标，输入即渲染 */
.render-edit {
flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 8px 32px 0;
  font-size: var(--editor-font-size);
  line-height: var(--editor-line-height);
  outline: none;
  word-break: break-word;
  scrollbar-gutter: stable;
}
.render-edit:empty::before {
content: '从一个想法开始，慢慢写下来…'; color: #a1a89d; pointer-events: none;
}
.render-edit .md-blank { min-height: 0.875em; } /* 空行最小高度确保编辑光标可见 */
/* Typora 式延迟渲染：光标所在块显示 Markdown 源码（等宽字体，原始字符可见） */
.render-edit .md-source {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SF Mono", Consolas, "Courier New", monospace;
  font-size: calc(var(--editor-font-size) * 0.9);
  line-height: 1.75;
  color: var(--text);
}
/* 行内标记源码（光标在 **/\`/[] 内时临时显示源码字符，Typora 同款） */
.render-edit .md-inline-src {
  font-family: "SF Mono", Consolas, "Courier New", monospace;
  font-size: calc(var(--editor-font-size) * 0.87);
  color: var(--text);
  background: rgba(65, 102, 83, .08);
  border-radius: 3px;
  padding: 0 2px;
}

/* 排版规则（迁移自 preview） */
.render-edit h1 { font-size: calc(var(--editor-font-size) * 1.47); margin: 1em 0 0.5em; }
.render-edit h2 { font-size: calc(var(--editor-font-size) * 1.27); margin: 0.9em 0 0.4em; }
.render-edit h3, .render-edit h4, .render-edit h5, .render-edit h6 { font-size: calc(var(--editor-font-size) * 1.07); margin: 0.8em 0 0.3em; }
.render-edit h1, .render-edit h2, .render-edit h3, .render-edit h4, .render-edit h5, .render-edit h6 { min-height: calc(var(--editor-line-height) * 1em); }
.render-edit h1:first-child, .render-edit h2:first-child, .render-edit h3:first-child { margin-top: 0.25em; }
.render-edit p { margin: 0.4em 0; line-height: var(--editor-line-height); }
.render-edit ul, .render-edit ol { margin: 0.4em 0; padding-left: 1.6em; line-height: var(--editor-line-height); }
.render-edit li { margin: 0.1em 0; min-height: calc(var(--editor-line-height) * 1em); }
.render-edit hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1em 0;
}
.render-edit code {
  background: var(--bg);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: "SF Mono", Consolas, "Courier New", monospace;
  font-size: 12.5px;
}
.render-edit pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8em;
  overflow-x: auto;
  margin: 0.5em 0;
}
.render-edit pre code { background: none; padding: 0; font-size: 12.5px; line-height: 1.6; }
.render-edit blockquote {
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 6px 6px 0;
  padding: 0.4em 0.9em;
  margin: 0.5em 0;
  color: var(--text-2);
  /* 空引用块也保持完整行高（随字号联动），避免只有 padding 高度被“压缩一半” */
  line-height: var(--editor-line-height);
  min-height: calc(var(--editor-line-height) * 1em);
}
.render-edit a { color: var(--accent); }
.render-edit .empty-preview { color: var(--text-2); }

/* 目录面板（浮层，右上角） */
.toc-panel {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 7; /* 高于覆盖编辑 textarea(z5) 与工具栏(z6) */
  width: 230px;
  max-height: 75%;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
  overflow: hidden;
}
.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.toc-list {
  overflow-y: auto;
  padding: 6px;
  font-size: 12.5px;
}
.toc-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--text-2);
  cursor: pointer;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .12s, color .12s;
}
.toc-item:hover { background: var(--accent-soft); color: var(--accent); }
.toc-item.lv-1 { padding-left: 8px; font-weight: 600; color: var(--text); }
.toc-item.lv-2 { padding-left: 20px; }
.toc-item.lv-3 { padding-left: 32px; color: var(--text-3); }
.toc-empty { padding: 10px 12px; color: var(--text-2); font-size: 12px; text-align: center; }

/* 笔记列表项内的小标签 */
.note-tag {
  display: inline-block;
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0 7px;
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--text-2);
  margin-left: 4px;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

/* 编辑器快捷标签区 */
.quick-tags {
display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 0 6px 31px;
}
.quick-tags .qt-label { font-size: 11px; color: var(--text-2); margin-right: 2px; }
.qt-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 11px;
  color: var(--text-2);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.qt-chip:hover { background: var(--accent-soft); color: var(--accent); border-color: #b8c9bc; }
.qt-chip.on { background: var(--brand-soft, #eaf0ff); border-color: var(--accent); color: var(--accent); }
.qt-empty { font-size: 11px; color: var(--text-3); }

.tags-row {
display: flex; align-items: center; gap: 8px; padding: 4px 0 9px; margin: 0; border: none;
}
.tags-row label { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.tags-input {
flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 12px; color: var(--text-2); padding: 5px 0;
}

/* AI 总结面板 */
.summary-panel {
flex: 0 0 320px;
  width: 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: none;
  border-left: 1px solid var(--border);
  border-radius: 0;
  margin: 0;
  min-height: 0;
}
.summary-header {
display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
}
.summary-body {
flex: 1;
  min-height: 0;
  padding: 20px;
  font-size: 13px;
  line-height: 1.9;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
}
.error-box {
  background: #fdecec;
  border: 1px solid #f5c2c4;
  color: #b3261e;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  margin: 0 2px;
  animation: bounce 1s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: .15s; }
.loading-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce {
  0%, 100% { opacity: .3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

/* ============ 提问式复盘 ============ */
.review-view {
flex: 1;
  min-width: 0;
  min-height: 0;
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
  padding: 36px 36px 40px;
  overflow-y: auto;
}

.review-header {
display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 28px;
}
.review-header h2 {
font-size: 25px; font-weight: 650; letter-spacing: -.3px;
}
.review-meta {
color: var(--text-2); font-size: 12px; margin-top: 8px; line-height: 1.8; overflow-wrap: anywhere;
}
.review-header-actions { display: flex; align-items: center; gap: 6px; }

.review-question-card {
background: var(--accent-soft); border: 1px solid #d9e2d5; border-radius: 14px; padding: 24px 26px;
}
.review-q-label {
font-size: 11px; color: var(--accent); letter-spacing: 1px; margin-bottom: 12px; font-weight: 600;
}
.review-q-text {
font-size: 18px; line-height: 1.8;
}

.review-answer {
width: 100%; min-height: 160px; border: 1px solid var(--border); border-radius: 12px; padding: 18px 22px; font-size: 15px; color: var(--text); background: var(--panel); line-height: 1.8; resize: vertical; outline: none; margin-top: 18px; transition: border-color .15s, box-shadow .15s;
}
.review-answer:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(65, 102, 83, .13);
}

.review-actions { margin-top: 10px; }

.verdict-area {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.verdict-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
}
.verdict-badge.yes { background: #e8f6ef; color: #1f7a4d; }
.verdict-badge.partial { background: #fdf3e0; color: #9a6700; }
.verdict-badge.no { background: #fdecec; color: #c43e43; }

.verdict-comment { margin-top: 12px; line-height: 1.75; font-size: 14px; }

.reference-box {
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.reference-toggle {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--accent);
}
.reference-toggle:hover { background: var(--bg); }
.reference-body { padding: 0 14px 12px; font-size: 13px; line-height: 1.75; }

.verdict-actions { margin-top: 14px; display: flex; gap: 8px; }

/* 复盘报告 */
.report-header h2 {
font-size: 25px; font-weight: 650;
}
.report-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.stat-card {
background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 22px 8px; text-align: center;
}
.stat-card .num {
font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.stat-card .label { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.stat-card.good .num { color: var(--success); }
.stat-card.partial .num { color: var(--warning); }
.stat-card.bad .num { color: var(--danger); }

.report-section {
margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border);
}
.report-section h3 { font-size: 14px; margin-bottom: 8px; }
.weak-topics { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text);
}
.suggestions { padding-left: 22px; line-height: 1.9; font-size: 13.5px; }
.report-actions { margin-top: 24px; }

/* ============ 模态 ============ */
.modal-overlay {
position: fixed; inset: 0; background: rgba(33, 45, 36, .32); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px; backdrop-filter: blur(3px);
}
.modal {
background: var(--panel); border: 1px solid rgba(255, 255, 255, .7); border-radius: 18px; width: 480px; max-width: 94vw; max-height: calc(100dvh - 64px); overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 20px 80px rgba(33, 45, 36, .18); animation: modalIn .18s ease;
}
.modal.small { width: 340px; }
.modal-wide {
width: 640px;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}

/* 设置页 Tab 栏 */
.settings-tabs {
display: flex; gap: 8px; padding: 14px 26px 0; border-bottom: 1px solid var(--border); overflow-x: auto;
}
.settings-tab {
  flex-shrink: 0;
  white-space: nowrap;
  border: none;
  background: transparent;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.settings-tab:hover { color: var(--text); }
.settings-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* 修改密码：方式切换（原密码 / 邮箱验证码） */
.pwd-mode-tabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  margin: 2px 0 14px;
}
.pwd-mode-tab {
  border: none;
  background: transparent;
  padding: 6px 2px;
  font-size: 13px;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.pwd-mode-tab:hover { color: var(--text); }
.pwd-mode-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* 复盘历史记录 */
.history-list { min-height: 180px; max-height: 52vh; overflow-y: auto; }
.history-empty {
  padding: 40px 12px;
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.9;
}
.history-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.history-item:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(65, 102, 83, .10); }
.history-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.history-item-title {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-item-time { font-size: 11px; color: var(--text-2); flex-shrink: 0; }
.history-item-meta { font-size: 12px; color: var(--text-2); margin-top: 5px; }
.history-item-acc {
  display: inline-block;
  margin-top: 7px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
}
.history-item-acc.good { background: #e8f6ef; color: #1f7a4d; }
.history-item-acc.mid { background: #fdf3e0; color: #9a6700; }
.history-item-acc.bad { background: #fdecec; color: #c43e43; }

/* 历史详情 */
.history-detail { max-height: 60vh; overflow-y: auto; }
.history-detail-title { font-size: 16px; font-weight: 700; margin-top: 6px; }
.history-detail-time { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.history-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 14px 0 4px;
}
.history-stat {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 4px;
  text-align: center;
}
.history-stat .num { display: block; font-size: 17px; font-weight: 700; }
.history-stat .lbl { font-size: 10.5px; color: var(--text-2); }
.history-stat.good .num { color: var(--success); }
.history-stat.partial .num { color: var(--warning); }
.history-stat.bad .num { color: var(--danger); }
.history-section { margin-top: 14px; }
.history-section-title { font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.history-chip {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  margin: 0 6px 6px 0;
}
.history-suggestions { padding-left: 20px; line-height: 1.85; font-size: 13px; }
.history-detail-actions { margin-top: 16px; display: flex; justify-content: flex-end; }

/* 回收站 */
.trash-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.trash-count { font-size: 12px; color: var(--text-2); }
.trash-list { min-height: 120px; max-height: 52vh; overflow-y: auto; }
.trash-empty {
  padding: 40px 12px;
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.9;
}
.trash-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 8px;
  background: var(--panel);
}
.trash-item-main { flex: 1; min-width: 0; }
.trash-item-title {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trash-summary-badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 8px;
  margin-left: 6px;
  vertical-align: 1px;
}
.trash-item-time { font-size: 11.5px; color: var(--text-2); margin-top: 4px; }
.trash-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.trash-item-actions .btn { padding: 5px 11px; font-size: 12px; }

.modal-header {
display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 22px 26px 4px;
}
.modal-header h2 {
font-size: 20px; font-weight: 650;
}

.modal-body {
padding: 18px 26px 10px; font-size: 13px; line-height: 1.75;
}
.modal-body label {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  margin: 12px 0 5px;
  font-weight: 600;
}
.modal-body input, .modal-body select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  background: var(--panel);
  transition: border-color .15s, box-shadow .15s;
}
.modal-body input:focus, .modal-body select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(65, 102, 83, .13);
}
.api-key-row { display: flex; gap: 8px; }
.api-key-row input { flex: 1; }
.hint { font-size: 12px; color: var(--text-2); margin: 10px 0 4px; line-height: 1.7; }

.modal-footer {
display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 18px 26px 24px;
}
.confirm-text { padding: 20px 20px 0; line-height: 1.7; font-size: 14px; }

/* ============ Toast ============ */
.toast-container {
  position: fixed;
  bottom: 46px; /* 抬升到备案号栏上方 */
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 9px 18px;
  border-radius: 999px;
  color: #fff;
  background: #35463b;
  font-size: 13px;
  box-shadow: var(--shadow);
  max-width: 82vw;
  animation: toastIn .25s ease;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-out { opacity: 0; transition: opacity .3s; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ============ 移动端侧边栏 ============ */
#sidebarBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .32);
  z-index: 55; /* 低于抽屉(61)：遮罩盖住内容区，抽屉浮于其上 */
}

@media (min-width: 769px) {
  #sidebarBackdrop { display: none; }
}

@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 34px; /* 给备案号栏让位 */
    z-index: 61; /* 高于遮罩(55)，抽屉浮于其上 */
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: none;
  }
  #sidebar.open { transform: none; box-shadow: 4px 0 24px rgba(0, 0, 0, .18); }
  .menu-btn { display: inline-flex; }
  .sidebar-resizer { display: none; } /* 移动端抽屉不支持拖拽调宽 */
  .sidebar-collapse-btn { display: none; } /* 移动端用菜单按钮开关抽屉 */

  .topbar { padding: 0 10px; gap: 6px; }
  .topbar-actions { gap: 4px; }
  .topbar-actions .btn { padding: 6px 10px; font-size: 12px; }

  .editor-view { padding: 10px 16px 20px; }
  .review-view { padding: 14px 16px 24px; }
  .title-input { font-size: 20px; }
  .report-stats { grid-template-columns: repeat(2, 1fr); }
  .review-header { flex-wrap: wrap; }
}

/* ================= 账户与身份验证 ================= */
.auth-overlay {
position: fixed;
  inset: 0 0 var(--footer-h);
  z-index: 65;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 20% 25%, #e5ecdf 0, transparent 48%), radial-gradient(ellipse at 85% 85%, #eee9dd 0, transparent 48%), #f5f4ee;
  padding: 32px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.auth-overlay.hidden { display: none; }
.auth-card {
width: 100%;
  max-width: 440px;
  max-height: 100%;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid #e2e6d9;
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(48, 65, 43, .09), 0 2px 8px rgba(48, 65, 43, .03);
  padding: 34px 38px 28px;
}
.auth-logo {
display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 21px; font-weight: 650; letter-spacing: 1px; color: var(--accent-dark);
}
.auth-sub {
text-align: center; color: var(--text-2); margin: 10px 0 24px; font-size: 13px; line-height: 1.8;
}
.auth-tabs {
display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 4px; margin-bottom: 20px;
}
.auth-tab {
flex: 1; min-height: 38px; padding: 7px 0; border: none; border-radius: 6px; background: transparent; color: var(--text-2); font-size: 12.5px; font-weight: 500;
}
.auth-tab.active {
background: var(--panel); color: var(--accent-dark); box-shadow: 0 1px 5px rgba(43, 54, 45, .07);
}
.auth-form { display: flex; flex-direction: column; gap: 6px; }
.auth-form label { font-size: 13px; color: var(--text-2); margin-top: 6px; }
.auth-form input {
min-width: 0; min-height: 43px; padding: 10px 12px; color: var(--text); background: var(--panel); border: 1px solid #dce1d5; border-radius: 8px; font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.auth-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(65, 102, 83, .13); }
/* 注册第二步（验证码后的建号字段）在普通 div 内，不是 flex 项；
   label 默认 inline、input 默认宽度，会与相邻字段挤成一行（阶梯错位）。
   显式块级化，与表单其它部分的“标签在上、输入框占满整行”保持一致 */
#regRegisterStep > label, .email-other label { display: block; }
#regRegisterStep input, .email-other input { display: block; width: 100%; box-sizing: border-box; }
.auth-submit {
margin-top: 18px; min-height: 44px; font-size: 14px; width: 100%;
}
.auth-error {
  background: #fdecec; color: #c0392b; border-radius: 8px; padding: 9px 12px;
  font-size: 13px; margin-top: 10px;
}
.auth-error.hidden { display: none; }

/* 注册同意勾选（用户协议 / 隐私政策） */
.agree-row {
  margin: 12px 0 4px;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--text-2);
}
#regRegisterStep .agree-row input[type="checkbox"], .email-other .agree-row input[type="checkbox"] { display: inline-block; width: auto; height: auto; padding: 0; margin: 0 5px 0 0; vertical-align: -2px; accent-color: var(--accent); }
.agree-row label { display: inline; cursor: pointer; white-space: nowrap; }
.agree-row a { display: inline; white-space: nowrap; color: var(--accent); text-decoration: none; }
.agree-row a:hover { text-decoration: underline; }
.auth-links { text-align: center; margin-top: 12px; }
.auth-back { display: block; margin-bottom: 12px; }
.reset-tip { font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }

/* ================= 账户与身份验证 ================= */
.user-bar { display: flex; align-items: center; gap: 8px; margin-right: 6px; }
.user-name { font-size: 13px; color: var(--text-2); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-link, .logout-btn { padding: 6px 10px; font-size: 13px; }
.logout-btn { color: #c0392b; }

/* ================= 账户与身份验证 ================= */
.account-info {
display: flex; align-items: center; flex-wrap: wrap; gap: 10px; background: var(--accent-soft); border: 1px solid #d9e2d5; border-radius: 12px; padding: 16px; margin-bottom: 6px;
}
.account-label { font-size: 13px; color: var(--text-3); }
.account-name { font-weight: 700; color: var(--accent-dark); font-size: 15px; }
.account-role {
  font-size: 12px; color: #fff; background: var(--accent); border-radius: 20px; padding: 2px 10px;
}
.account-section-title { margin: 18px 0 4px; font-size: 15px; color: #333; }
#accountPanel input { margin-bottom: 8px; }
#pwdError { margin: 6px 0 0; }

/* ================= 导出 / 表格 / 字符统计（本地版移植） ================= */
.export-all-btn { margin: 0 12px 8px; }
.render-edit table {
  border-collapse: collapse;
  margin: 0.5em 0;
  font-size: calc(var(--editor-font-size) * 0.92);
  line-height: 1.6;
  display: block;
  overflow-x: auto;
  max-width: 100%;
}
.render-edit th, .render-edit td {
  border: 1px solid var(--border);
  padding: 5px 12px;
  text-align: left;
  min-width: 40px;
}
.editor-stats {
flex-shrink: 0; text-align: right; padding: 10px 2px 13px; font-size: 10.5px; letter-spacing: .3px; color: var(--text-3); border-top: 1px solid var(--border); user-select: none; white-space: nowrap;
}

/* ================= 复盘多选确认框 / 错题回看 / 回收站复盘徽标（本地版移植） ================= */
.confirm-input {
  display: block;
  width: calc(100% - 40px);
  margin: 12px 20px 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: var(--panel);
}
.confirm-checks { margin: 12px 20px 0; max-height: 200px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 6px 4px; }
.confirm-check { display: block; padding: 6px 10px; border-radius: 6px; font-size: 13.5px; cursor: pointer; line-height: 1.5; }
.confirm-check:hover { background: var(--bg); }
.confirm-check input { margin-right: 8px; vertical-align: -1px; }
.confirm-stats {
  font-size: 12px;
  color: var(--text-2);
  padding: 0 2px 8px;
  line-height: 1.6;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 6px;
}
.confirm-stats.warn { color: var(--danger); font-weight: 600; }
.qa-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--surface);
}
.qa-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.qa-num { font-size: 12.5px; font-weight: 700; color: var(--text); }
.qa-verdict { font-size: 11.5px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.qa-verdict.yes { background: #e8f6ef; color: #1f7a4d; }
.qa-verdict.partial { background: #fdf3e0; color: #9a6700; }
.qa-verdict.no { background: #fdecec; color: #c43e43; }
.qa-field { font-size: 12.5px; line-height: 1.7; margin-top: 5px; color: var(--text); word-break: break-word; }
.qa-label { display: inline-block; font-size: 11px; color: var(--text-2); background: var(--bg); border-radius: 4px; padding: 0 6px; margin-right: 6px; }
.trash-summary-badge.review { background: #fdf3e0; color: #9a6700; }

/* ================= 邮箱验证码注册表单（验证码认证新增） ================= */
.email-row { display: flex; gap: 6px; }
.email-row input { flex: 1; min-width: 0; }
.email-domain { flex-shrink: 0; padding: 10px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: var(--panel); color: var(--text); outline: none; max-width: 130px; }
.email-other { margin-top: 6px; }
.email-other input { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; width: 100%; }
.email-other .hint { font-size: 12px; color: #b07d1e; margin-top: 4px; }
.code-row { display: flex; gap: 6px; }
.code-row input { flex: 1; min-width: 0; }
.code-row .btn { flex-shrink: 0; white-space: nowrap; }

/* 系统默认 AI 免费额度提示（设置 → API 设置） */
.system-ai-hint {
  background: var(--accent-soft); border: 1px solid #d4dfd4; color: var(--accent);
  border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.7; margin-bottom: 12px;
}
.system-ai-hint b { color: var(--accent-dark); }

/* 使用说明（设置 → 使用说明 Tab） */
.guide-content {
max-height: 55dvh; overflow-y: auto; padding-right: 10px; font-size: 13px; line-height: 1.85;
}
.guide-content h1, .guide-content h2, .guide-content h3, .guide-content h4 { margin: 14px 0 8px; line-height: 1.4; }
.guide-content h1 { font-size: 18px; }
.guide-content h2 { font-size: 16px; }
.guide-content h3, .guide-content h4 { font-size: 15px; }
.guide-content p { margin: 8px 0; }
.guide-content ul, .guide-content ol { margin: 8px 0; padding-left: 22px; }
.guide-content li { margin: 4px 0; }
.guide-content img { max-width: 100%; border-radius: 8px; }
.guide-content a { color: var(--accent); }
.guide-content blockquote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid #d4dfd4; color: var(--text-2); background: var(--surface); border-radius: 0 8px 8px 0; }
.guide-content code { font-family: Consolas, monospace; font-size: 13px; background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; }
.guide-content pre { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
.guide-content pre code { background: none; padding: 0; }
.guide-content hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.guide-loading { color: var(--text-3); text-align: center; padding: 20px 0; }

/* ================= 笔记广场 ================= */
.modal.plaza {
width: min(900px, 94vw);
}
.plaza .modal-body { padding: 20px 24px 22px; }
.plaza-publish {
background: var(--accent-soft); border: 1px solid #dbe4d6; border-radius: 12px; padding: 16px 18px; margin-bottom: 6px;
}
.plaza-form-label { font-size: 13px; font-weight: 600; color: var(--text); }
.plaza-publish-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.plaza-radio { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--text); }
.plaza-publish-row select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; }
.plaza-publish .hint { margin-top: 6px; }
.plaza-zone { margin-top: 22px; }
.plaza-sec-title {
  font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 10px;
  padding-left: 9px; border-left: 3px solid var(--accent); line-height: 1.4;
}
.plaza-sec-count { color: var(--text-3); font-weight: 400; }
.plaza-zone-empty { font-size: 13px; color: var(--text-3); padding: 6px 0 2px; }
.plaza-toolbar { margin-bottom: 10px; }
.plaza-toolbar input { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; }
.plaza-toolbar input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(65, 102, 83, .13); }
.plaza-list { display: flex; flex-direction: column; gap: 10px; }
.plaza-item {
border: 1px solid var(--border); border-radius: 12px; background: var(--panel); padding: 17px 18px;
}
.plaza-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plaza-title { font-size: 15px; }
.plaza-badge { font-size: 12px; background: var(--accent-soft); color: var(--text-2); border-radius: 10px; padding: 1px 8px; }
.plaza-badge.admin { background: var(--accent-soft); color: var(--accent-dark); }
.plaza-badge.pending { background: #fdf3e0; color: #b07d1e; }
.plaza-badge.rejected { background: #fdecec; color: #c0392b; }
.plaza-item-pending { background: #fffdf8; }
.plaza-reject-reason {
  margin-top: 6px; font-size: 13px; color: #c0392b; background: #fdf0ef;
  border: 1px solid #f5d3d1; border-radius: 8px; padding: 6px 10px; word-break: break-word;
}
.plaza-reject-reason b { font-weight: 600; }
.plaza-by { margin-left: auto; font-size: 12px; color: var(--text-3); }
.plaza-tags { margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; }
.plaza-tag { font-size: 12px; background: var(--accent-soft); color: var(--text-2); border-radius: 10px; padding: 1px 8px; }
.plaza-preview { margin-top: 6px; font-size: 13px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; max-height: 88px; overflow: hidden; }
.plaza-item-actions { margin-top: 8px; display: flex; gap: 8px; }
.plaza-fullview {
  margin-top: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--accent-soft);
  border-radius: 8px; max-height: 320px; overflow-y: auto; font-size: 14px;
}
.plaza-fullview .plaza-fv-title { font-size: 14px; font-weight: 600; color: var(--text); margin: 10px 0 6px; }
.plaza-fullview .plaza-fv-title:first-child { margin-top: 0; }
.plaza-fullview p { margin: 6px 0; }
.plaza-fullview ul, .plaza-fullview ol { margin: 6px 0; padding-left: 22px; }
.plaza-fullview img { max-width: 100%; border-radius: 6px; }
.plaza-fullview hr { border: none; border-top: 1px dashed var(--border); margin: 12px 0; }
.plaza-loading { color: var(--text-3); text-align: center; padding: 16px 0; }
.plaza-ver { font-size: 11px; color: #c3c9cd; font-family: Consolas, monospace; font-weight: 400; margin-left: 8px; }

/* ================= 栖屿工作区 ================= */
.ui-icon { width: 18px; height: 18px; display: block; flex: 0 0 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
button, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
input, textarea, select { color: var(--text); }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px; background: var(--accent); color: #fffefa; }
.brand-mark .ui-icon { width: 23px; height: 23px; }
.brand-wordmark { display: block; min-width: 0; white-space: nowrap; }
.brand-wordmark small { display: block; margin-top: 3px; color: var(--text-2); font-size: 10px; font-weight: 400; letter-spacing: .6px; }
.sidebar-header, .sidebar-create, .workspace-nav, .search-wrap, .list-heading, .sidebar-footer { flex-shrink: 0; }
.sidebar-create { padding: 0 18px; }
.new-note-btn { gap: 9px; box-shadow: 0 3px 7px rgba(46, 78, 60, .07); }
.new-note-hint { margin-left: auto; color: #dce7de; font-size: 10px; font-weight: 400; letter-spacing: .4px; }
.workspace-nav { display: flex; gap: 3px; padding: 10px 12px; }
.nav-btn { display: flex; align-items: center; justify-content: center; flex: 1; gap: 4px; min-width: 0; min-height: 35px; padding: 7px 2px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); white-space: nowrap; font-size: 11px; transition: background .15s, color .15s; }
.nav-btn:hover { color: var(--text); background: #eaece4; }
.nav-btn.active { color: var(--accent-dark); background: #e6ebe1; font-weight: 600; }
.nav-btn .ui-icon { width: 14px; height: 14px; flex-basis: 14px; }
.search-wrap > .ui-icon { position: absolute; top: 11px; left: 11px; width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.list-heading { position: relative; display: flex; align-items: center; gap: 2px; margin: 0 12px; padding: 0 0 6px; color: var(--text-2); font-size: 11px; }
.list-heading .list-label { display: flex; align-items: center; flex: 1; min-width: 0; padding-left: 6px; white-space: nowrap; }
#noteListLabel { overflow: hidden; text-overflow: ellipsis; }
.list-heading .sort-bar { margin: 0; padding: 0; flex-shrink: 0; }
.list-heading .sort-select { width: 82px; padding-inline: 3px; font-size: 10.5px; }
.list-heading details { flex-shrink: 0; padding: 0; }
.list-heading summary.icon-btn { display: flex; align-items: center; justify-content: center; width: 30px; height: 32px; min-height: 32px; padding: 0; }
.list-heading details[open] > summary, .tag-section.has-filter > summary { background: var(--accent-soft); color: var(--accent-dark); }
.tag-section.has-filter > summary { box-shadow: inset 0 0 0 1px #b9cdbd; }
.tag-popover { position: absolute; top: 100%; left: 0; right: 0; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); box-shadow: 0 10px 28px rgba(36, 52, 40, .12); z-index: 80; }
.popover-heading { padding: 2px 4px 8px; color: var(--text-2); font-size: 11px; font-weight: 500; }
.density-dropdown { top: 100%; right: 0; min-width: 210px; }
.density-dropdown > button { flex-direction: column; align-items: flex-start; gap: 2px; }
.density-dropdown > button small { font-size: 10px; color: var(--text-2); }
.density-dropdown > button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-dark); }
.density-dropdown > button[aria-pressed="true"] > span::after { content: ' ✓'; }
.note-count { margin-left: 5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tag-title { justify-content: space-between; min-height: 27px; border-radius: 4px; }
.tag-title .ui-icon { width: 14px; height: 14px; flex-basis: 14px; transition: transform .15s; }
.tag-section[open] .tag-list { padding-top: 0; max-height: min(230px, 35dvh); overflow-y: auto; overscroll-behavior: contain; }
.note-item-preview { margin-top: 3px; color: var(--text-2); font-size: 11.5px; line-height: 1.65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-item:focus-visible { outline-offset: -2px; }
.note-item:focus-within .note-del, .note-del:focus-visible { opacity: 1; }
.note-item.active .note-tag { background: rgba(255, 254, 250, .62); }
.sidebar-footer { position: relative; padding: 8px 16px 12px; border-top: 1px solid var(--border); }
.sidebar-utilities { display: flex; align-items: center; gap: 2px; padding-bottom: 8px; }
.utility-btn { display: flex; align-items: center; justify-content: center; gap: 5px; flex: 1; min-width: 0; min-height: 32px; padding: 6px 3px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); white-space: nowrap; font-size: 10.5px; }
.utility-btn .ui-icon { width: 14px; height: 14px; flex-basis: 14px; }
.utility-btn:hover { background: var(--accent-soft); color: var(--accent-dark); }
.account-menu { position: relative; }
.user-bar { display: flex; align-items: center; gap: 9px; width: 100%; margin: 0; padding: 8px 4px; border-radius: 8px; }
.user-bar:hover, .account-menu[open] .user-bar { background: #eaece4; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border: 1px solid #d8dfd2; border-radius: 50%; background: #e9eee3; color: var(--accent); }
.avatar .ui-icon { width: 15px; height: 15px; }
.account-summary { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 2px; }
.user-name { display: block; color: var(--text); font-size: 12px; font-weight: 500; max-width: none; }
.account-summary small { font-size: 10px; color: var(--text-3); }
.user-bar > .ui-icon { width: 14px; height: 14px; flex-basis: 14px; color: var(--text-3); }

/* 原生 details 菜单保留键盘操作，菜单项目始终纵向排列。 */
.action-menu { position: relative; flex-shrink: 0; }
.dropdown-menu { position: absolute; display: flex; flex-direction: column; gap: 3px; min-width: 180px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); box-shadow: 0 10px 28px rgba(36, 52, 40, .12); z-index: 80; }
.dropdown-menu > button, .dropdown-menu > a { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; min-height: 36px; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font-size: 12px; text-align: left; text-decoration: none; white-space: nowrap; }
.dropdown-menu > button:hover:not(:disabled), .dropdown-menu > a:hover { background: var(--accent-soft); color: var(--accent-dark); }
.dropdown-menu > button:disabled { opacity: .45; cursor: not-allowed; }
.dropdown-menu > .logout-btn { color: var(--danger); }
.account-dropdown { bottom: calc(100% + 6px); left: 0; right: 0; }
.action-dropdown { top: calc(100% + 10px); right: 0; }
.workspace-context { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.workspace-kicker { font-size: 11px; color: var(--text-2); letter-spacing: .5px; white-space: nowrap; }
.workspace-caption { font-size: 10px; color: var(--text-3); white-space: nowrap; }
.topbar-actions > .btn { font-size: 11.5px; padding-inline: 11px; }
.ai-action { color: var(--accent); border-color: #cedbcf; background: #f1f5ed; }
.ai-action:hover:not(:disabled) { background: var(--accent-soft); }
.review-action { border-color: transparent; background: transparent; }
.focus-btn[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.workspace-body { position: relative; display: flex; flex: 1; min-width: 0; min-height: 0; overflow: hidden; }
.main-loading, .empty-state { align-self: stretch; }
.empty-state { overflow-y: auto; }
.empty-icon .ui-icon { width: 36px; height: 36px; }
.empty-eyebrow { margin: 8px 0 0; font-size: 10px; letter-spacing: 2px; color: var(--accent); }
.empty-footnote { margin-top: 14px; font-size: 10px; letter-spacing: .3px; color: var(--text-3); }
.editor-eyebrow { flex-shrink: 0; font-size: 10px; letter-spacing: 1.5px; color: var(--text-3); padding-bottom: 12px; }
.note-properties { flex-shrink: 0; margin: 0 0 17px; min-width: 0; }
.note-properties > summary { display: flex; align-items: center; gap: 4px; width: fit-content; min-height: 26px; color: var(--text-3); font-size: 11px; border-radius: 4px; }
.note-properties > summary:hover { color: var(--accent); }
.note-properties > summary .ui-icon { width: 13px; height: 13px; flex-basis: 13px; transition: transform .15s; }
.note-properties[open] > summary .ui-icon { transform: rotate(180deg); }
.note-properties[open] { max-height: 170px; overflow-y: auto; }
.tags-input:focus-visible { outline: 0; box-shadow: 0 1px var(--accent); }
.editor-controls { display: flex; align-items: center; gap: 16px; flex-shrink: 0; min-width: 0; padding: 10px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.md-toolbar { scrollbar-width: thin; }
.md-toolbar::-webkit-scrollbar { height: 3px; }
.font-size-label { min-width: 17px; text-align: center; font-size: 10px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.render-edit img, .summary-body img, .reference-body img { max-width: 100%; height: auto; }
.render-edit { padding-top: 22px; }
.content-input { padding-top: 22px; }
.editor-stats { color: #778272; }
.summary-heading { display: grid; grid-template-columns: 18px 1fr; align-items: center; gap: 7px; color: var(--accent-dark); }
.summary-heading .ui-icon { color: var(--accent); }
.summary-caption { grid-column: 1 / -1; font-size: 10px; font-weight: 400; color: var(--text-3); letter-spacing: .3px; }
.summary-header { flex-shrink: 0; }
.summary-body h1, .summary-body h2, .summary-body h3, .summary-body h4 { margin: 1.2em 0 .5em; font-size: 15px; color: var(--text); }
.summary-body > :first-child { margin-top: 0; }
.summary-body p { margin: .6em 0; }
.summary-body ul, .summary-body ol { padding-left: 20px; margin: .6em 0; }
.summary-body li { margin: .3em 0; }
.summary-body blockquote { margin: 12px 0; padding-left: 12px; border-left: 2px solid #b8cab7; color: var(--text-2); }
.summary-body pre { padding: 12px; border: 1px solid var(--border); border-radius: 7px; overflow-x: auto; background: var(--panel); }
.summary-body code { font-family: Consolas, monospace; font-size: 12px; }
.summary-body a { color: var(--accent); }
.summary-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.summary-body th, .summary-body td { padding: 6px; border: 1px solid var(--border); }
.summary-footer { flex-shrink: 0; padding: 16px 20px 20px; border-top: 1px solid var(--border); }
.summary-footer p { margin-bottom: 12px; font-size: 10px; color: var(--text-3); line-height: 1.7; }
.summary-footer .btn { width: 100%; font-size: 11px; }
.summary-backdrop { display: none; }
.auth-intro { margin-top: 26px; }
.auth-intro h1 { font-size: 21px; font-weight: 550; line-height: 1.65; text-align: center; letter-spacing: -.3px; }
.auth-intro .auth-sub { margin-top: 7px; font-size: 12px; }
.auth-logo .brand-mark { width: 38px; height: 38px; flex-basis: 38px; }
.auth-form input[type="checkbox"] { min-height: 0; }
.modal-body input[type="radio"], .modal-body input[type="checkbox"] { width: auto; padding: 0; accent-color: var(--accent); }
.plaza-publish-row .plaza-radio { display: inline-flex; align-items: center; margin: 0; font-size: 12px; font-weight: 400; }
.plaza-publish-row select { width: auto; max-width: 100%; }
.plaza-item-actions { flex-wrap: wrap; }
.modal-body input, .modal-body select { min-width: 0; }
.guide-content, .qa-field, .reference-body, .verdict-comment, .review-q-text { overflow-wrap: anywhere; }

/* 抽屉只覆盖书写区，避免缩窄正文；侧边导航与对话框位于其上。 */
@media (max-width: 1200px) {
  .topbar { gap: 8px; padding-inline: 20px; }
  .workspace-caption { display: none; }
  .topbar-actions { gap: 5px; }
  .editor-view { padding-inline: 28px; }
  .summary-panel { flex-basis: 300px; width: 300px; }
}
@media (max-width: 1100px) {
  .workspace-context { display: none; }
  .topbar-actions > .btn { width: 36px; padding: 7px; }
  .topbar-actions > .btn > span { display: none; }
  .summary-panel { position: absolute; z-index: 48; inset: 0 0 0 auto; width: 360px; max-width: calc(100% - 24px); box-shadow: -12px 0 30px rgba(36, 52, 40, .10); }
  .summary-backdrop { display: block; position: absolute; z-index: 46; inset: 0; background: rgba(36, 49, 38, .20); }
  .editor-controls { gap: 10px; }
}
@media (max-width: 768px) {
  :root { --topbar-h: 64px; }
  #sidebar { width: min(310px, calc(100vw - 40px)); min-width: 0; height: calc(100dvh - var(--footer-h)); bottom: var(--footer-h); }
  .sidebar-collapse-btn { display: none; }
  .sidebar-header { padding: 20px 18px 16px; }
  .topbar { gap: 4px; padding: 0 12px; }
  .topbar-actions { gap: 3px; flex: 0 0 auto; }
  .topbar-actions > .btn { width: 40px; min-height: 40px; padding: 8px; }
  .focus-btn { display: none; }
  .save-status { flex: 1; min-width: 0; margin-left: 4px; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .editor-view { padding: 23px 22px 0; }
  .editor-eyebrow { padding-bottom: 8px; }
  .title-input { font-size: 25px; padding-bottom: 8px; }
  .note-properties { margin-bottom: 12px; }
  .editor-controls { gap: 9px; padding-block: 8px; }
  .mode-btn { padding-inline: 8px; }
  .md-toolbar { gap: 0; }
  .render-edit, .content-input { padding-top: 18px; }
  .review-view { padding: 24px 20px 32px; }
  .review-header { gap: 12px; margin-bottom: 20px; }
  .review-header h2 { font-size: 22px; }
  .review-question-card { padding: 20px; }
  .review-q-text { font-size: 16px; }
  .review-answer { padding: 15px 17px; }
  .summary-panel { width: 360px; max-width: calc(100% - 18px); }
  .summary-header { padding: 20px 18px 16px; }
  .summary-body { padding: 18px; }
  .summary-footer { padding: 14px 18px 18px; }
  .empty-state { padding: 24px; }
  .empty-state h2 { font-size: 22px; }
  .empty-state p { font-size: 12px; }
  .empty-footnote { font-size: 9px; }
  .modal-overlay { padding: 12px; }
  .modal { max-width: 100%; max-height: calc(100dvh - 24px); border-radius: 14px; }
  .modal-header { padding: 18px 18px 4px; }
  .modal-header h2 { font-size: 18px; }
  .modal-body, .plaza .modal-body { padding: 16px 18px 10px; }
  .modal-footer { padding: 16px 18px 20px; }
  .settings-tabs { padding: 12px 14px 0; gap: 2px; }
  .settings-tab { padding-inline: 10px; font-size: 12px; }
  .history-item-head { flex-wrap: wrap; }
  .history-item-title { width: 100%; }
  .history-stats { grid-template-columns: repeat(3, 1fr); }
  .trash-item { align-items: flex-start; flex-wrap: wrap; padding: 12px; }
  .trash-item-main { min-width: 150px; }
  .trash-item-actions { margin-left: auto; }
  .plaza-publish { padding: 14px; }
  .plaza-item { padding: 14px; }
  .plaza-by { width: 100%; margin-left: 0; }
  .auth-overlay { padding: 20px 16px; }
  .auth-card { max-width: 420px; padding: 28px 26px 24px; border-radius: 16px; }
  .auth-intro h1 { font-size: 20px; }
  .site-footer { font-size: 9px; }
}
@media (max-width: 390px) {
  .topbar { padding-inline: 8px; }
  .topbar-actions { gap: 0; }
  .save-status { max-width: 65px; margin-left: 2px; }
  .editor-view { padding-inline: 17px; }
  .title-input { font-size: 23px; }
  .editor-controls { gap: 7px; }
  .auth-card { padding: 26px 20px 22px; }
  .auth-intro h1 { font-size: 18px; }
  .auth-logo { font-size: 20px; }
  .email-domain { max-width: 110px; padding-inline: 6px; }
  .code-row .btn { padding-inline: 9px; font-size: 11px; }
  .modal-body, .plaza .modal-body { padding-inline: 14px; }
  .settings-tab { padding-inline: 9px; }
}
@media (pointer: coarse) {
  .icon-btn, .md-btn, .topbar-actions > .btn { min-width: 44px; height: 44px; }
  .btn, .nav-btn, .utility-btn, .tag-title, .mode-btn, .settings-tab, .auth-tab, .note-properties > summary, .toc-item, .dropdown-menu > button, .dropdown-menu > a { min-height: 44px; }
  .tag-chip, .qt-chip { min-height: 36px; }
  .note-del { width: 44px; height: 44px; opacity: .65; }
  .sort-select, .search-wrap input { min-height: 44px; }
  .search-wrap > .ui-icon { top: 14px; }
}
@media (max-height: 700px) {
  .sidebar-header { padding-top: 14px; padding-bottom: 13px; }
  .workspace-nav { padding-top: 10px; padding-bottom: 10px; gap: 0; }
  .search-wrap { margin-bottom: 8px; }
  .sidebar-footer { padding-top: 5px; padding-bottom: 5px; }
  .sidebar-utilities { padding-bottom: 3px; }
  .editor-view { padding-top: 20px; }
  .editor-eyebrow { padding-bottom: 5px; }
  .note-properties { margin-bottom: 10px; }
  .empty-state { gap: 8px; }
  .empty-icon { width: 58px; height: 58px; border-radius: 18px; }
  .empty-icon .ui-icon { width: 29px; height: 29px; }
}
@media (max-height: 560px) {
  #sidebar { overflow-y: auto; overscroll-behavior: contain; }
  .note-list { min-height: 110px; }
  .tag-section[open] .tag-list { max-height: 80px; }
  .editor-view { overflow-y: auto; padding-top: 14px; }
  .editor-area { min-height: 200px; }
  .editor-eyebrow { display: none; }
  .empty-state { justify-content: flex-start; }
  .auth-overlay { padding-block: 12px; }
  .auth-card { max-height: 100%; }
  .auth-intro { margin-top: 16px; }
  .summary-header { padding-block: 14px; }
  .summary-footer { padding-block: 10px; }
  .summary-footer p { margin-bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* 优先把垂直空间留给笔记；密度只改变侧栏，不影响正文字号。 */
.sidebar-header { padding: 18px 18px 16px; }
.sidebar-footer { display: flex; align-items: center; gap: 6px; padding: 6px 12px; }
.sidebar-utilities { order: 1; flex-shrink: 0; gap: 2px; padding: 0; }
.sidebar-utilities .utility-btn { width: 32px; height: 36px; padding: 0; }
.sidebar-utilities .utility-btn > span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sidebar-utilities .utility-btn .ui-icon { width: 16px; height: 16px; flex-basis: 16px; }
.sidebar-footer .account-menu { flex: 1; min-width: 0; }
.sidebar-footer .user-bar { padding: 3px 2px; gap: 6px; min-height: 36px; }
.sidebar-footer .account-summary small { display: none; }
.sidebar-footer .avatar { width: 26px; height: 26px; flex-basis: 26px; }
.sidebar-footer .account-dropdown { right: auto; }
.compact-list .sidebar-header { padding: 12px 18px; }
.compact-list .brand-wordmark small { display: none; }
.compact-list .brand-mark { width: 30px; height: 30px; flex-basis: 30px; border-radius: 9px; }
.compact-list .new-note-btn { min-height: 36px; padding-block: 6px; }
.compact-list .workspace-nav { padding-block: 7px; }
.compact-list .search-wrap { margin-bottom: 7px; }
.compact-list .note-item { padding: 7px 10px; margin-bottom: 2px; }
.compact-list .note-item-title { font-size: 13px; line-height: 20px; }
.compact-list .note-item-preview { display: none; }
.compact-list .note-item-meta { margin-top: 2px; line-height: 18px; }
.compact-list .note-item-meta .note-tag { padding-block: 0; line-height: 18px; }
@media (pointer: coarse) {
  .list-heading summary.icon-btn { width: 44px; height: 44px; min-height: 44px; }
  .list-heading .sort-select { width: 76px; }
  .list-heading { margin-inline: 8px; }
  .list-heading .list-label { padding-left: 2px; }
  .sidebar-utilities .utility-btn { width: 44px; height: 44px; }
  .sidebar-footer .user-bar, .compact-list .new-note-btn { min-height: 44px; }
}

/* ===== 功能改进批（2026-10-24）：F04/F06/F07/F09/F10 ===== */
/* F07 总结过期徽标 */
.summary-stale { margin: 0 0 10px; padding: 8px 12px; border: 1px solid #e3d9b0; background: #faf6e6; color: #7a6a2f; font-size: 13px; border-radius: 4px; }
/* F06 未作答 */
.qa-verdict.muted { color: #7a828c; }
/* F04 复盘阅读范围 */
.review-readscope { color: #7a828c; font-size: 12.5px; margin-top: 4px; }
/* F10 关闭 AI 开关 */
.ai-switch-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid #d9d9d4; border-radius: 4px; margin-bottom: 14px; cursor: pointer; }
.ai-switch-row input { margin-top: 3px; }
.ai-switch-row span { font-size: 13px; color: #4a5058; }
/* F09 总结失败卡片 */
.summary-fail-card { border: 1px solid #e0c4c4; background: #faf0f0; padding: 12px; border-radius: 4px; font-size: 14px; }
.summary-fail-card .fail-detail { margin-top: 8px; font-family: Consolas, monospace; font-size: 12px; color: #7a828c; }
.summary-fail-card .fail-actions { margin-top: 10px; }

/* ===== 复盘范围选择面板（F-面板 2026-10-24） ===== */
.modal.review-select { width: min(680px, 94vw); }
.review-select-body { display: flex; flex-direction: column; gap: 12px; }
.review-select-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.review-select-toolbar { display: flex; align-items: center; gap: 12px; }
.review-select-toolbar .link-btn { padding: 0; }
.review-select-hint { font-size: 12px; color: #7a828c; margin-left: auto; text-align: right; }
.review-select-list { flex: 1 1 auto; overflow-y: auto; border: 1px solid #d9d9d4; border-radius: 6px; padding: 6px; min-height: 200px; max-height: 46vh; }
.review-select-list .note-item { cursor: pointer; }
.review-select-list .note-item:hover { background: #eaece4; }
.review-select-list .note-item.picked { background: #eaf2f7; }
.review-select-list .note-item.picked .note-item-title { color: var(--accent-dark); }
.review-select-check { flex: none; width: 22px; height: 22px; margin-left: 8px; border: 1.5px solid #b8c4bd; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; color: transparent; align-self: center; }
.review-select-item.picked .review-select-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.review-select-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid #d9d9d4; flex-wrap: wrap; }
.review-select-stats { font-size: 13.5px; color: #4a5058; }
.review-select-stats b { color: var(--ink); }
.review-select-stats .review-select-over { display: block; color: #b3474b; font-size: 12.5px; margin-top: 2px; }
.review-select-actions { display: flex; gap: 10px; }

/* ===== 页脚公安联网备案（2026-10-24） ===== */
.site-footer img { height: 20px; width: auto; margin: 0 4px; vertical-align: middle; }
