/* ============================================================
 * 唤醒笔记 · 纸墨系样式
 * 约束：所有颜色必须走 :root 变量，本文件其他地方不许出现颜色字面量。
 * 移动优先：390px 第一视口；桌面端中列最大 640px 居中。
 * ============================================================ */

:root {
  /* 品牌色板（纸墨系） */
  --paper: #F6F3EC;
  --paper-deep: #EFE9DB;
  --ink: #2C2822;
  --ink-soft: #6B6257;
  --gold: #C9A96A;
  --cinnabar: #A6533C;
  --card: #FFFDF8;
  --line: #E5DDCB;

  /* 衍生 token：字面量只允许出现在这里 */
  --ink-faint: rgba(44, 40, 34, 0.38);
  --ink-ghost: rgba(44, 40, 34, 0.12);
  --gold-soft: rgba(201, 169, 106, 0.16);
  --gold-glow: rgba(201, 169, 106, 0.45);
  --gold-deep: #A98A4E;
  --card-warm: #FBF8F0;
  --overlay: rgba(44, 40, 34, 0.45);
  --shadow-card: 0 1px 2px rgba(44, 40, 34, 0.05), 0 10px 28px rgba(44, 40, 34, 0.07);
  --shadow-pop: 0 8px 30px rgba(44, 40, 34, 0.16);
  --danger: #A6533C;
  --danger-soft: rgba(166, 83, 60, 0.1);
  --mark: rgba(201, 169, 106, 0.5);

  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-brand: "Songti SC", "STSong", "Noto Serif SC", serif;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* hidden 属性优先级最高：覆盖各组件的 display 设定 */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--gold) var(--paper);
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}

img { max-width: 100%; height: auto; display: block; }

button { font-family: inherit; touch-action: manipulation; }
input, textarea { font-family: inherit; font-size: 16px; } /* 16px 防 iOS 聚焦缩放 */

.sr-only {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- 离线横幅 ---------- */
.offline-banner {
  position: sticky; top: 0; z-index: 60;
  background: var(--cinnabar);
  color: var(--card);
  text-align: center;
  font-size: 14px;
  padding: 10px 16px;
}

/* ---------- 布局 ---------- */
.app-shell { min-height: 100vh; min-height: 100dvh; }

.view { min-height: 100vh; min-height: 100dvh; }

/* 中列：移动全宽，桌面最大 640px 居中 */
.topbar-row, .feed-wrap, .sub-header-inner {
  width: 100%;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
}

.topbar-row + .topbar-row { padding-top: 10px; }

.brand-mini { display: flex; align-items: center; gap: 10px; }

.brand-seal-sm {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-brand);
  font-size: 19px;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.brand-mini-name {
  font-family: var(--font-brand);
  font-size: 20px;
  letter-spacing: 0.12em;
}

.topbar-actions { display: flex; gap: 4px; }

.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  cursor: pointer;
}

.icon-btn:hover { background: var(--paper-deep); color: var(--ink); }
.icon-btn:active { transform: scale(0.94); }

/* 搜索触发器：看起来像输入框的按钮 */
.search-trigger {
  flex: 1;
  display: flex; align-items: center; gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  color: var(--ink-faint);
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.search-trigger:hover { border-color: var(--gold); }
.search-trigger-text { flex: 1; font-size: 15px; }
.search-trigger-kbd {
  font-family: inherit;
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* ---------- 信息流 ---------- */
.feed-wrap { padding-top: 16px; padding-bottom: 72px; }

/* ---------- 编辑器卡片 ---------- */
.editor-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 14px 14px 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.editor-card:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft), var(--shadow-card);
}

#editor {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  resize: none;
  min-height: 76px;
  line-height: 1.7;
  padding: 4px 2px;
}

#editor::placeholder { color: var(--ink-faint); }
#editor:focus { outline: none; }

.editor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 8px;
}

.editor-tools { display: flex; gap: 2px; }

.tool-btn {
  min-width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 18px;
  cursor: pointer;
  padding: 0 8px;
}

.tool-btn:hover { background: var(--paper-deep); color: var(--ink); }
.tool-btn:active { transform: scale(0.94); }
.tool-btn.busy { opacity: 0.45; pointer-events: none; }

.editor-side { display: flex; align-items: center; gap: 10px; }

.word-count { font-size: 12px; color: var(--ink-faint); white-space: nowrap; }

.btn-send {
  border: 0;
  border-radius: var(--radius-pill);
  padding: 9px 22px;
  font-size: 15px;
  cursor: pointer;
  background: var(--ink-ghost);
  color: var(--ink-faint);
  transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.btn-send:not(:disabled) {
  background: var(--gold);
  color: var(--ink);
  font-weight: 600;
}

.btn-send:not(:disabled):hover { background: var(--gold-deep); color: var(--card); }
.btn-send:not(:disabled):active { transform: scale(0.96); }
.btn-send:disabled { cursor: not-allowed; }

/* ---------- 过滤条 ---------- */
.filter-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  border-radius: var(--radius-pill);
  padding: 8px 8px 8px 16px;
  margin-top: 14px;
  font-size: 14px;
}

.filter-label { color: var(--ink-soft); white-space: nowrap; }
.filter-value {
  flex: 1;
  font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.filter-clear {
  border: 0; border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
}

/* ---------- 笔记卡片 ---------- */
.memo-list { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }

.memo {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 14px 16px 12px;
  overflow-wrap: anywhere;
}

.memo-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.memo-head time {
  font-size: 12.5px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.memo-menu-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: var(--radius-pill);
  color: var(--ink-faint);
  font-size: 22px; line-height: 1;
  letter-spacing: 0;
  cursor: pointer;
  flex-shrink: 0;
  transform: translateY(-2px);
}

.memo-menu-btn:hover { background: var(--paper-deep); color: var(--ink); }

.memo-menu-sep { height: 1px; background: var(--line); margin: 4px 6px; }
.memo-menu-foot {
  padding: 8px 14px 6px;
  font-size: 12px; color: var(--ink-faint);
  border-top: 1px solid var(--line); margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.memo-body { font-size: 16px; line-height: 1.75; }
.memo-body p { margin: 0 0 0.6em; }
.memo-body p:last-child { margin-bottom: 0; }
.memo-body ul, .memo-body ol { margin: 0.4em 0; padding-left: 1.6em; }
.memo-body li { margin: 0.25em 0; }
.memo-body img {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  margin: 8px 0;
}

/* 标签 pill */
.tag-pill {
  display: inline-block;
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  color: var(--ink);
  border-radius: var(--radius-pill);
  padding: 1px 10px;
  margin: 1px 2px;
  font-size: 0.85em;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.7;
  white-space: nowrap;
}

button.tag-pill { font-family: inherit; }
.tag-pill:hover { background: var(--gold); }

mark {
  background: var(--mark);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

/* 就地编辑 */
.memo-edit-area {
  width: 100%;
  min-height: 120px;
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  background: var(--card-warm);
  color: var(--ink);
  padding: 10px 12px;
  line-height: 1.7;
  resize: vertical;
}

.memo-edit-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

.btn-ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  border-radius: var(--radius-pill);
  padding: 7px 18px;
  font-size: 14px;
  cursor: pointer;
}

.btn-ghost:hover { border-color: var(--gold); color: var(--ink); }

.btn-solid {
  border: 0;
  background: var(--gold);
  color: var(--ink);
  border-radius: var(--radius-pill);
  padding: 7px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-solid:hover { background: var(--gold-deep); color: var(--card); }

/* ---------- 列表尾 ---------- */
.list-end {
  display: flex; align-items: center; gap: 12px;
  margin: 28px 0 8px;
  color: var(--ink-faint);
  font-size: 13px;
}

.list-end-line { flex: 1; height: 1px; background: var(--line); }

/* ---------- 卡片菜单 ---------- */
.memo-menu {
  position: fixed; z-index: 70;
  min-width: 148px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  padding: 6px;
  display: flex; flex-direction: column;
}

.memo-menu button {
  border: 0; background: transparent;
  text-align: left;
  padding: 10px 14px;
  font-size: 15px;
  color: var(--ink);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.memo-menu button:hover { background: var(--paper-deep); }
.memo-menu button.danger { color: var(--danger); }
.memo-menu button.danger:hover { background: var(--danger-soft); }

.memo-menu-confirm {
  padding: 16px;
  gap: 12px;
  max-width: calc(100vw - 48px);
}

.memo-menu-confirm p { margin: 0; font-size: 15px; }

.memo-menu-confirm-btns { display: flex; justify-content: flex-end; gap: 8px; }

.danger-solid {
  border: 0;
  background: var(--danger);
  color: var(--card);
  border-radius: var(--radius-pill);
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- 登录 / 注册 ---------- */
#view-auth {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 20px 40px;
}

.auth-wrap { width: 100%; max-width: 380px; text-align: center; }

.brand-seal-lg {
  width: 76px; height: 76px;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-brand);
  font-size: 42px;
  border-radius: 18px;
  box-shadow: inset 0 0 0 2px var(--gold), var(--shadow-card);
}

.brand-name {
  font-family: var(--font-brand);
  font-size: 34px;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  margin: 0 0 6px;
  font-weight: 600;
}

.brand-tagline {
  color: var(--ink-soft);
  font-size: 14px;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  margin: 0 0 30px;
}

.auth-tabs {
  display: flex;
  background: var(--paper-deep);
  border-radius: var(--radius-pill);
  padding: 4px;
  margin-bottom: 22px;
}

.auth-tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: var(--radius-pill);
  padding: 10px;
  font-size: 15px;
  color: var(--ink-soft);
  cursor: pointer;
}

.auth-tabs button.active {
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-card);
}

#authForm { text-align: left; }

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--ink);
}

.field input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }

.auth-error {
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 14px;
  margin: 0 0 14px;
}

.btn-primary {
  width: 100%;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--gold);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  padding: 13px;
  cursor: pointer;
}

.btn-primary:hover { background: var(--gold-deep); color: var(--card); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-note {
  margin-top: 26px;
  font-size: 13px;
  color: var(--ink-faint);
  line-height: 1.8;
}

/* ---------- 子页面头 ---------- */
.sub-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.sub-header-inner {
  display: flex; align-items: center; gap: 8px;
  padding-top: 12px; padding-bottom: 12px;
}

.sub-header h2 {
  margin: 0;
  font-family: var(--font-brand);
  font-size: 19px;
  letter-spacing: 0.14em;
  font-weight: 600;
}

/* ---------- 标签树 ---------- */
.tags-hint { color: var(--ink-soft); font-size: 14px; margin: 4px 0 14px; }

.tag-tree { display: flex; flex-direction: column; gap: 6px; }

.tag-node {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.tag-node:hover { border-color: var(--gold); }

.tag-node .tag-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-node .tag-name::before { content: "#"; color: var(--gold-deep); margin-right: 2px; }

.tag-count {
  background: var(--paper-deep);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  border-radius: var(--radius-pill);
  font-size: 12px;
  padding: 2px 10px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.empty-note {
  color: var(--ink-faint);
  font-size: 14px;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  line-height: 2;
}

.empty-note code {
  background: var(--gold-soft);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: inherit;
}

/* ---------- 设置 ---------- */
.settings-group {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 18px;
  margin-bottom: 16px;
}

.settings-group h3 {
  margin: 0 0 4px;
  font-family: var(--font-brand);
  font-size: 17px;
  letter-spacing: 0.1em;
}

.settings-desc { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 12px; }

.settings-actions { display: flex; flex-direction: column; }

.btn-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 13px 4px;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.btn-row:first-child { border-top: 0; }
.btn-row:hover { color: var(--gold-deep); }
.btn-row-sub { font-size: 12.5px; color: var(--ink-faint); }

.account-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
}

.account-avatar {
  width: 44px; height: 44px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-brand);
  font-size: 22px;
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.account-name { font-weight: 600; font-size: 15px; }
.account-email { font-size: 13px; color: var(--ink-soft); }

.btn-danger {
  width: 100%;
  border: 1px solid var(--danger);
  background: transparent;
  color: var(--danger);
  border-radius: var(--radius-pill);
  padding: 12px;
  font-size: 15px;
  cursor: pointer;
}

.btn-danger:hover { background: var(--danger-soft); }

.version-note {
  text-align: center;
  color: var(--ink-faint);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  margin: 24px 0 0;
}

/* ---------- 搜索浮层 ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: var(--overlay);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 8vh 16px 16px;
}

.search-panel {
  width: 100%;
  max-width: 640px;
  max-height: 76vh;
  max-height: 76dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}

.search-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}

#searchInput {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink);
  min-width: 0;
}

#searchInput:focus { outline: none; }
#searchInput::placeholder { color: var(--ink-faint); }

.search-results {
  overflow-y: auto;
  padding: 12px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-hint { color: var(--ink-faint); font-size: 14px; text-align: center; padding: 24px 0; }

.search-result { cursor: pointer; }
.search-result:hover { border-color: var(--gold); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 90;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-pill);
  padding: 10px 22px;
  font-size: 14px;
  box-shadow: var(--shadow-pop);
  max-width: calc(100vw - 48px);
  text-align: center;
}

/* ---------- 桌面端微调 ---------- */
@media (min-width: 700px) {
  .feed-wrap { padding-top: 22px; }
  #view-auth { padding-top: 10vh; }
  .search-overlay { padding-top: 12vh; }
}

/* ---------- 减少动态 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ---------- 回顾按钮 ---------- */
.review-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 14px;
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-size: 14px; font-family: inherit;
  cursor: pointer;
}
.review-btn:hover { background: var(--gold); }
.review-btn svg { flex-shrink: 0; }

/* ---------- 通用弹窗 ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: var(--overlay);
  display: flex; justify-content: center; align-items: center;
  padding: 20px 16px;
}
.modal {
  width: 100%; max-width: 560px;
  max-height: 82vh; max-height: 82dvh;
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px 14px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.modal-head h2 { margin: 0; font-size: 17px; font-family: var(--font-brand); font-weight: 600; }

/* ---------- 随机回顾 ---------- */
.review-main { display: flex; min-height: 0; flex: 1; }
.review-dots {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 20px 2px 20px 16px;
  overflow-y: auto; flex-shrink: 0;
}
.review-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 0; padding: 0; cursor: pointer;
  background: var(--ink-ghost);
  flex-shrink: 0;
}
.review-dot.active { background: var(--gold-deep); transform: scale(1.3); }
.review-stage { flex: 1; min-width: 0; padding: 16px 16px 16px 12px; overflow-y: auto; }
.review-stage .memo { margin: 0; }
.review-foot {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  padding: 12px 16px 18px; flex-shrink: 0;
}
.pager-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  font-size: 24px; line-height: 1;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  padding-bottom: 4px;
}
.pager-btn:hover { border-color: var(--gold); color: var(--ink); }
.pager-btn:disabled { opacity: 0.35; cursor: default; }
.review-count {
  font-size: 14px; color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  min-width: 46px; text-align: center;
}
.review-done { text-align: center; padding: 36px 20px; }
.review-done p { font-size: 16px; margin: 0 0 22px; }
.review-empty { text-align: center; color: var(--ink-faint); padding: 40px 20px; font-size: 15px; line-height: 1.8; }

/* ---------- 历史版本 ---------- */
.versions-main { display: flex; min-height: 0; flex: 1; }
.versions-list {
  width: 42%; max-width: 220px; flex-shrink: 0;
  border-right: 1px solid var(--line);
  overflow-y: auto; padding: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.version-item {
  border: 0; background: transparent; text-align: left;
  padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; gap: 4px;
}
.version-item:hover { background: var(--paper-deep); }
.version-item.active { background: var(--gold-soft); }
.version-time { font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.version-snippet {
  font-size: 13.5px; color: var(--ink-soft);
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.versions-content { flex: 1; min-width: 0; padding: 16px 18px; overflow-y: auto; font-size: 15.5px; line-height: 1.8; }
.versions-empty { color: var(--ink-faint); text-align: center; padding: 40px 20px; font-size: 15px; line-height: 1.8; }

/* ---------- 引用深链 ---------- */
.link-modal { max-width: 520px; }
.link-body { padding: 16px; overflow-y: auto; }
.link-body .memo { margin: 0; }

/* ---------- @ 引用下拉 ---------- */
.editor-card { position: relative; }
.mention-box {
  position: absolute; z-index: 60;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  padding: 6px;
  display: flex; flex-direction: column;
  max-height: 264px; overflow-y: auto;
}
.mention-item {
  border: 0; background: transparent; text-align: left;
  padding: 9px 12px; border-radius: var(--radius-sm);
  cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; gap: 3px;
}
.mention-item.active, .mention-item:hover { background: var(--gold-soft); }
.mention-time { font-size: 11.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.mention-summary {
  font-size: 14px; color: var(--ink);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.mention-empty { padding: 12px; font-size: 13.5px; color: var(--ink-faint); text-align: center; }

/* ---------- markdown 内链 ---------- */
.md-link { color: var(--gold-deep); text-decoration: underline; text-underline-offset: 2px; }
.md-link:hover { color: var(--ink); }

/* ---------- 菜单箭头 ---------- */
.menu-arrow { font-size: 12px; color: var(--ink-faint); margin-left: 2px; }

/* ---------- 小屏：弹窗全屏化 ---------- */
@media (max-width: 699px) {
  .modal-overlay { padding: 0; }
  .modal {
    max-width: none; max-height: none;
    height: 100%; height: 100dvh;
    border: 0; border-radius: 0;
  }
  .versions-main { flex-direction: column; }
  .versions-list {
    width: auto; max-width: none; max-height: 32%;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
}
