/* ==========================================================================
   Note.i.t · 样式表
   设计约束：不使用任何外部字体/图片/CDN —— 严格 CSP 下,零第三方请求。
   ========================================================================== */

:root {
  --bg: #f5f4fa;
  --surface: #ffffff;
  --surface-2: #ebe9f3;
  --side-bg: #f1f0f7;
  --border: #e7e5ee;
  --text: #282635;
  --muted: #625d71;
  --accent: #7160b8;
  --accent-strong: #5d489b;
  --accent-soft: #e7e1f6;
  --danger: #d64545;
  --danger-soft: #fdecec;
  --warn: #b7791f;
  --warn-soft: #fdf3e2;
  --ok: #2f855a;
  --shadow: 0 1px 2px rgba(20, 20, 43, .06), 0 8px 24px rgba(20, 20, 43, .06);
  --radius: 12px;
  --serif: "Noto Serif SC", "Songti SC", STSong, SimSun, serif;
  --radius-sm: 8px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131218;
    --surface: #1b1a21;
    --surface-2: #24222c;
    --side-bg: #17161d;
    --border: #2c2a35;
    --text: #e8e6ef;
    --muted: #9d99ab;
    --accent: #a99ae0;
    --accent-strong: #bcaeeb;
    --accent-soft: #2a2540;
    --danger: #f08a8a;
    --danger-soft: #3a2020;
    --warn: #e2b866;
    --warn-soft: #332915;
    --ok: #7bd6a4;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
  }
}

:root[data-theme="dark"] {
  --bg: #131218;
  --surface: #1b1a21;
  --surface-2: #24222c;
  --side-bg: #17161d;
  --border: #2c2a35;
  --text: #e8e6ef;
  --muted: #9d99ab;
  --accent: #a99ae0;
  --accent-strong: #bcaeeb;
  --accent-soft: #2a2540;
  --danger: #f08a8a;
  --danger-soft: #3a2020;
  --warn: #e2b866;
  --warn-soft: #332915;
  --ok: #7bd6a4;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app { min-height: 100%; display: flex; flex-direction: column; }

h1, h2, h3, h4 { line-height: 1.3; margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--accent); }
code { font-family: var(--mono); font-size: .92em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------- 启动态 ------------------------------- */
.boot {
  flex: 1; display: grid; place-content: center; justify-items: center; gap: 14px;
  color: var(--muted); min-height: 60vh;
}
.boot-spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--border); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ------------------------------- 通用控件 ------------------------------- */
.btn {
  appearance: none; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: var(--radius-sm); padding: 8px 14px;
  font: inherit; font-size: 14px; cursor: pointer; display: inline-flex;
  align-items: center; gap: 7px; transition: background .15s, border-color .15s, transform .06s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn-danger { color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-icon { padding: 7px 9px; }
.btn svg { width: 16px; height: 16px; flex: none; }

input, textarea, select { font: inherit; color: inherit; }
.input {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--muted); opacity: .75; }

.field { display: grid; gap: 6px; }
.field > label { font-size: 13px; color: var(--muted); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted);
}
.pill-ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

.tag {
  font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); cursor: pointer; border: 1px solid transparent;
}
.tag[data-active="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

.banner {
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13.5px;
  display: flex; gap: 9px; align-items: flex-start; line-height: 1.5;
}
.banner-info { background: var(--surface-2); color: var(--muted); }
.banner-warn { background: var(--warn-soft); color: var(--warn); }
.banner-danger { background: var(--danger-soft); color: var(--danger); }
.banner-ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }

/* ------------------------------- 落地页 ------------------------------- */
.landing { flex: 1; display: flex; flex-direction: column; }
.landing-header {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 22px; max-width: 1060px; width: 100%; margin: 0 auto;
}
.landing-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 650; text-decoration: none; color: inherit; }
.landing-brand img { width: 26px; height: 26px; border-radius: 7px; }
.landing-nav { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.landing-nav a { color: var(--muted); text-decoration: none; font-size: 14px; padding: 6px 10px; border-radius: 7px; }
.landing-nav a:hover { background: var(--surface-2); color: var(--text); }

.landing-main { flex: 1; max-width: 1060px; width: 100%; margin: 0 auto; padding: 10px 22px 60px; }
.hero { display: grid; gap: 34px; grid-template-columns: 1fr; padding: 26px 0 34px; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.05fr .95fr; align-items: center; padding: 48px 0 56px; } }
.hero h1 { font-size: clamp(30px, 5vw, 46px); letter-spacing: -.03em; }
.hero-lead { color: var(--muted); font-size: 16px; margin-top: 14px; max-width: 44ch; }

.entry-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px; box-shadow: var(--shadow); margin-top: 24px; max-width: 520px;
}
.entry-row { display: flex; gap: 8px; }
.entry-row .input { flex: 1; }
.entry-error { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 8px; }
.entry-help { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.entry-help strong { color: var(--warn); font-weight: 600; }

.facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; color: var(--muted); font-size: 13.5px; }
.facts span { display: inline-flex; align-items: center; gap: 6px; }
.facts svg { width: 15px; height: 15px; color: var(--ok); }

.illustration {
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface);
  padding: 22px; box-shadow: var(--shadow);
}
.illustration h3 { font-size: 15px; }
.flow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0 10px; color: var(--muted); font-size: 13.5px; }
.flow svg { width: 16px; height: 16px; color: var(--accent); }
.diagram {
  border-radius: 12px; background: var(--surface-2); padding: 16px;
  font-family: var(--mono); font-size: 12px; color: var(--muted); line-height: 1.75;
  white-space: pre; overflow-x: auto;
}

.section { margin-top: 52px; }
.section-head h2 { font-size: 22px; }
.section-head p { color: var(--muted); margin-top: 6px; }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.card h3 { font-size: 15px; margin-bottom: 6px; }
.card p { color: var(--muted); font-size: 13.5px; }
.card h4 { font-size: 14px; margin-bottom: 4px; }
.card-icon { width: 20px; height: 20px; color: var(--accent); margin-bottom: 10px; }

.recent { margin-top: 18px; display: grid; gap: 8px; max-width: 520px; }
.recent-title { font-size: 13px; color: var(--muted); }
.recent-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; cursor: pointer; font: inherit; color: inherit;
}
.recent-item:hover { border-color: var(--accent); }
.recent-item .grow { display: grid; }
.recent-item .name { font-weight: 550; }
.recent-item .meta { font-size: 12px; color: var(--muted); }

details.faq { border-top: 1px solid var(--border); padding: 14px 0; }
details.faq summary { cursor: pointer; font-weight: 550; list-style: none; display: flex; align-items: center; gap: 8px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::before { content: "＋"; color: var(--muted); font-weight: 400; }
details.faq[open] summary::before { content: "－"; }
details.faq p { color: var(--muted); font-size: 13.5px; margin-top: 8px; padding-left: 20px; }

.footer { border-top: 1px solid var(--border); margin-top: 56px; padding-top: 18px; color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* ===========================================================================
   解锁界面 + 笔记本工作区
   下面这套数值按参考站 simibiji.org 的页面截图逐项校正：侧栏 284/34-30-18、
   工具栏 61px、内容 max-width 864、
   标题走衬线字体栈、正文 16px/1.9。改之前请先量一遍再改。
   =========================================================================== */

/* ------------------------------- 解锁界面 ------------------------------- */
.unlock-wrap {
  min-height: 100vh; min-height: 100dvh; display: grid; place-content: center;
  justify-items: center; gap: 18px; padding: 40px 20px; background: var(--bg);
}
.unlock-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.unlock-brand img { width: 38px; height: 38px; border-radius: 11px; }
.unlock-dialog {
  position: relative; width: min(94vw, 430px); background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 26px; box-shadow: 0 6px 24px rgba(48, 35, 77, .05); display: grid; gap: 12px;
}
.unlock-title { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.unlock-close { position: absolute; top: 12px; right: 12px; }
.unlock-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.check-row { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); cursor: pointer; }
.check { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.progress { height: 3px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 30%; background: var(--accent); border-radius: 999px; animation: slide 1.1s ease-in-out infinite alternate; }
@keyframes slide { from { margin-left: 0; } to { margin-left: 70%; } }

/* ------------------------------- 笔记本工作区 ------------------------------- */
.nb { display: flex; height: 100vh; height: 100dvh; overflow: hidden; background: var(--bg); }

/* ---- 左侧栏：284px 宽，顶部留 34px 白，各块之间用 margin 而不是 gap ---- */
.nb-side {
  width: 284px; flex: none; display: flex; flex-direction: column;
  padding: 34px 30px 18px; overflow-y: auto;
  background: var(--side-bg); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; height: 81px; flex: none; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; flex: none; }
.brand-text { display: grid; min-width: 0; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand-sub { font-size: 12px; color: var(--muted); }

.side-action {
  appearance: none; border: 1px solid var(--border); background: var(--surface);
  font: inherit; font-size: 13px; font-weight: 500; color: var(--muted);
  height: 44px; padding: 0 15px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; gap: 8px; text-align: left; flex: none;
}
.side-action:hover { background: var(--surface-2); color: var(--text); }
.side-action.primary {
  font-size: 14px; font-weight: 600; color: var(--accent-strong);
  border-color: #c1badd; margin-bottom: 8px;
}
.side-action.primary:hover { background: var(--accent-soft); border-color: var(--accent); }
.side-action.ghost { border-color: transparent; background: transparent; margin-bottom: 26px; }
.side-action kbd { margin-left: auto; }

.side-heading {
  display: flex; align-items: center; gap: 8px; height: 36px; margin-bottom: 12px;
  font-size: 13px; color: var(--muted); flex: none;
}
.count-badge { background: var(--accent-soft); color: var(--accent-strong); border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 600; }
.side-mini {
  appearance: none; border: none; background: transparent; color: var(--muted); width: 28px; height: 28px;
  border-radius: 7px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.side-mini:hover { background: var(--surface-2); color: var(--text); }

.side-search {
  display: flex; align-items: center; gap: 9px; height: 44px; padding: 0 13px; margin-bottom: 15px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; color: var(--muted); flex: none;
}
.search-input { border: none; background: transparent; outline: none; font: inherit; font-size: 14px; flex: 1; min-width: 0; color: var(--text); }

.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.side-list { display: grid; align-content: start; margin: 0 -8px; }
.side-empty { padding: 26px 16px; color: var(--muted); text-align: center; font-size: 13px; }
.page-item {
  appearance: none; border: 1px solid transparent; background: transparent; text-align: left;
  font: inherit; padding: 12px; border-radius: 9px; margin-bottom: 5px; cursor: pointer;
  display: grid; gap: 5px; color: var(--text);
}
.page-item:hover { background: var(--surface-2); }
.page-item[data-active="true"] { background: var(--accent-soft); border-color: transparent; }
.page-item[data-active="true"] .page-title { color: var(--accent-strong); }
.page-row { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.page-title { font-size: 14px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-time { font-size: 11.5px; color: var(--muted); flex: none; font-weight: 400; }
.page-title mark, .page-snippet mark {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  color: var(--accent-strong); border-radius: 3px; padding: 0 1px; font-weight: 650;
}
.page-snippet { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.page-tags .tag { font-size: 11px; padding: 0 7px; cursor: default; }
.side-add {
  appearance: none; border: 1px dashed var(--border); background: transparent; color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 500; height: 44px; margin-top: 5px;
  border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; flex: none;
}
.side-add:hover { color: var(--accent-strong); border-color: var(--accent); background: var(--accent-soft); }

.side-bottom { margin-top: auto; padding-top: 26px; display: grid; gap: 2px; flex: none; }
.side-link {
  appearance: none; border: none; background: transparent; color: var(--text); font: inherit; font-size: 13px;
  height: 44px; padding: 0 12px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; gap: 10px; text-align: left; width: 100%;
}
.side-link:hover { background: var(--surface-2); }
.side-link svg { color: var(--muted); flex: none; }
.side-link em { margin-left: auto; font-style: normal; font-size: 11.5px; color: var(--muted); }
.side-row { display: flex; align-items: center; gap: 4px; }
.side-row .side-link { flex: 1; width: auto; }
.side-privacy {
  display: flex; gap: 10px; margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--border); color: var(--muted); font-size: 11.5px; line-height: 1.75;
}
.side-privacy svg { color: var(--accent); flex: none; margin-top: 3px; }

/* ---- 主区：顶栏 94px / 纸面铺满 / 底部提示条 40px ---- */
.nb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0 28px 0 24px; }
.nb-top { display: flex; align-items: center; gap: 8px; height: 94px; flex: none; }
.nb-top-unlocked {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto;
  align-items: center; align-content: stretch; gap: 4px 16px; padding: 12px 0 10px; margin-right: -4px;
}
.nb-top-unlocked > .grow { display: none; }
.nb-top-unlocked .top-actions {
  grid-column: 2; grid-row: 1; display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}
.nb-top-unlocked .top-divider { width: 1px; height: 20px; margin: 0; background: var(--border); flex: none; }
.nb-top-unlocked .top-actions .btn-icon svg { width: 17px; height: 17px; }
.nb-top-unlocked .top-actions .btn-primary { gap: 8px; }
.nb-top-unlocked .top-actions .btn-primary svg { width: 20px; height: 20px; }
.nb-top-unlocked .save-hint {
  grid-column: 1 / -1; grid-row: 2; width: 100%; max-width: none; align-self: stretch;
}
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; min-width: 0; }
.crumbs svg { color: var(--border); }
.crumb-current { color: var(--text); font-weight: 600; font-size: 14px; }
.save-box { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.save-hint { font-size: 12px; color: var(--muted); text-align: right; max-width: 340px; }
.save-hint[data-state="idle"] { color: var(--ok); }
.save-hint[data-state="draft"] { color: var(--muted); }
.save-hint[data-state="dirty"], .save-hint[data-state="offline"] { color: var(--warn); }
.save-hint[data-state="error"] { color: var(--danger); }
.nb-top .btn-icon { width: 40px; height: 40px; padding: 0; justify-content: center; }
.nb-top .btn-primary { height: 44px; padding: 0 16px; border-radius: 8px; box-shadow: 0 3px 7px rgba(113, 96, 184, .07); }

.doc-card {
  flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 6px 24px rgba(48, 35, 77, .024);
  overflow: hidden; margin-bottom: 4px;
}

/* ---- 工具栏：61px 高，页签撑满整行，下划线贴在工具栏底边 ---- */
.doc-toolbar { display: flex; align-items: center; gap: 12px; padding: 0 24px 0 27px; min-height: 61px; border-bottom: 1px solid var(--border); flex: none; }
.tabs { display: flex; align-items: stretch; gap: 22px; margin-right: 14px; }
.tab {
  appearance: none; border: none; background: transparent; color: var(--muted); font: inherit;
  font-size: 13px; font-weight: 600; padding: 0 2px; cursor: pointer; position: relative;
  display: inline-flex; align-items: center; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[data-on="true"] { color: var(--accent-strong); }
.tab[data-on="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); border-radius: 2px; }
.tools { display: flex; align-items: center; gap: 6px; align-self: center; }
.tools::before { content: ""; width: 1px; height: 18px; background: var(--border); margin: 0 24px 0 0; flex: none; }
.tool {
  appearance: none; border: none; background: transparent; color: var(--muted); width: 30px; height: 30px;
  border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.tool:hover { background: var(--surface-2); color: var(--text); }
.tool[data-on="true"] { background: var(--accent-soft); color: var(--accent-strong); }
.tool-font-size svg { display: block; }
.tool-sep { width: 1px; height: 18px; background: var(--border); margin: 0 8px; flex: none; }
.focus-btn { align-self: center; height: 44px; padding: 0 11px; border-radius: 8px; font-size: 12px; font-weight: 500; color: var(--text); gap: 6px; }
.focus-btn[data-on="true"] { background: var(--accent-soft); color: var(--accent-strong); }
.toolbar-more-btn { width: 44px; padding: 0; justify-content: center; color: var(--text); }
.toolbar-more-btn svg { width: 17px; height: 17px; }
.toolbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: none; margin-left: auto; }
.more-wrap { position: relative; align-self: center; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 232px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 6px 24px rgba(48, 35, 77, .1); display: grid; gap: 1px;
}
.menu-item {
  appearance: none; border: none; background: transparent; color: var(--text); font: inherit; font-size: 13.5px;
  text-align: left; padding: 9px 11px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 10px;
}
.menu-item:hover:not(:disabled) { background: var(--surface-2); }
.menu-item:disabled { color: var(--muted); opacity: .55; cursor: not-allowed; }
.menu-item svg { color: var(--muted); flex: none; }
.menu-item-danger, .menu-item-danger svg { color: var(--danger); }
.menu-sep { height: 1px; background: var(--border); margin: 5px 4px; }

/* ---- 纸面内容：30/32/24 内边距 + 864px 上限，宽屏下行长不会失控 ---- */
.doc-body { flex: 1; min-height: 0; overflow-y: auto; padding: 30px 32px 24px; }
.doc-head { display: grid; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.doc-meta-line { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; flex-wrap: nowrap; min-width: 0; overflow: hidden; }
.doc-meta-line .doc-date { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta-line .doc-badge { flex: none; }
.doc-badge { display: inline-flex; align-items: center; gap: 5px; background: var(--surface-2); border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.doc-title {
  border: none; background: transparent; outline: none; padding: 0; color: var(--text); width: 100%;
  font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1.5; letter-spacing: 0;
}
.doc-title::placeholder { color: var(--muted); opacity: .45; }
.doc-tag-row { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.doc-tags-input { border: none; background: transparent; outline: none; font: inherit; font-size: 13px; color: var(--muted); flex: 1; min-width: 120px; }
.doc-panes { display: grid; grid-template-columns: 1fr; gap: 22px; }
.doc-panes[data-view="split"] { grid-template-columns: 1fr 1fr; }
.doc-editor {
  width: 100%; border: none; background: transparent; outline: none; resize: none; font: inherit;
  font-size: 16px; line-height: 1.9; letter-spacing: .16px; color: var(--text); min-height: 46vh; display: block;
}
.doc-panes[data-view="split"] .doc-editor { border-right: 1px solid var(--border); padding-right: 18px; }
.doc-panes[data-view="preview"] .doc-editor { display: none; }
/* 宽屏下把正文行宽限制在参考站同款（864 减去左右内边距），分屏模式除外 */
.doc-head, .doc-panes[data-view="edit"], .doc-panes[data-view="preview"] { max-width: 800px; }

.nb[data-font="large"] .doc-editor, .nb[data-font="large"] .preview { font-size: 18px; }
.nb[data-font="xlarge"] .doc-editor, .nb[data-font="xlarge"] .preview { font-size: 20px; }

.preview { overflow-y: auto; padding: 0; background: transparent; min-height: 0; font-size: 16px; line-height: 1.9; }
.preview > :first-child { margin-top: 0; }
.preview h1 { font-family: var(--serif); font-size: 26px; margin: 22px 0 10px; }
.preview h2 { font-family: var(--serif); font-size: 21px; margin: 20px 0 8px; }
.preview h3 { font-family: var(--serif); font-size: 18px; margin: 16px 0 6px; }
.preview h4, .preview h5, .preview h6 { font-size: 16px; margin: 14px 0 6px; }
.preview p { margin: 12px 0; }
.preview ul, .preview ol { margin: 12px 0; padding-left: 24px; }
.preview li { margin: 5px 0; }
.preview blockquote { margin: 14px 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--border); color: var(--muted); }
.preview pre { background: var(--surface-2); padding: 14px 16px; border-radius: 10px; overflow-x: auto; margin: 14px 0; }
.preview pre code { background: none; padding: 0; font-size: 13.5px; }
.preview hr { border: none; border-top: 1px solid var(--border); margin: 22px 0; }
.preview table { border-collapse: collapse; margin: 14px 0; width: 100%; font-size: 14.5px; }
.preview th, .preview td { border: 1px solid var(--border); padding: 7px 11px; text-align: left; }
.preview img { max-width: 100%; border-radius: 8px; }
.preview .task { list-style: none; margin-left: -20px; }
.preview .task input { margin-right: 8px; }

/* ---- 状态栏 44px ---- */
.doc-status {
  display: flex; align-items: center; gap: 5px 16px; flex-wrap: wrap;
  min-height: 44px; padding: 9px 24px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 12px; flex: none;
}
.stat { display: inline-flex; align-items: center; gap: 5px; }
.stat-ok { color: var(--ok); }
.stat-warn { color: var(--warn); }

.hintbar { display: flex; align-items: center; gap: 9px; height: 40px; flex: none; color: var(--muted); font-size: 12px; }
.hintbar svg { color: var(--accent); flex: none; }
.hint-label { margin-right: 8px; }
kbd {
  font-family: var(--mono); font-size: 11px; background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px;
}
.empty-main { flex: 1; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); text-align: center; padding: 30px; }
.nb-back { display: none; }
.side-close { display: none; }

/* ------------------------------- 锁定状态 ------------------------------- */
.nb-locked .locked-status {
  display: inline-flex; align-items: center; gap: 7px; color: var(--ok); font-size: 12px; white-space: nowrap;
}
.locked-status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.locked-top-lock { border-left: 1px solid var(--border); border-radius: 0; margin-left: 2px; }
.locked-save { height: 44px; padding: 0 16px; border-radius: 8px; }
.side-search-locked { color: var(--muted); }
.side-search-locked > span { font-size: 13px; }
.locked-side-message { padding: 26px 5px; color: var(--muted); font-size: 12px; }
.nb-locked .side-action:disabled, .nb-locked .side-add:disabled,
.nb-locked .side-mini:disabled, .nb-locked .side-link:disabled { opacity: .48; cursor: not-allowed; }
.nb-locked .side-add { border-color: transparent; justify-content: flex-start; padding-left: 12px; }
.nb-locked .side-row .side-link { flex: 1; width: auto; }
.doc-toolbar-locked { overflow: hidden; }
.doc-toolbar-locked .tabs, .doc-toolbar-locked .tools, .doc-toolbar-locked .toolbar-right { flex: none; }
.doc-toolbar-locked .tab:disabled, .doc-toolbar-locked .tool:disabled,
.doc-toolbar-locked .focus-btn:disabled { opacity: .58; cursor: not-allowed; }
.doc-toolbar-locked .tool:disabled:hover { background: transparent; color: var(--muted); }
.doc-toolbar-locked .menu-locked {
  position: fixed; min-width: min(232px, calc(100vw - 16px)); max-height: calc(100vh - 16px);
  max-height: calc(100dvh - 16px); overflow-y: auto; overscroll-behavior: contain;
}
.locked-doc-body { display: grid; place-items: center; padding: 24px; }
.locked-panel { display: grid; justify-items: center; text-align: center; gap: 14px; padding: 24px; }
.locked-panel-icon {
  display: grid; place-items: center; width: 76px; height: 76px; border-radius: 24px;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 5px;
}
.locked-panel-name { color: var(--accent-strong); font-size: 12px; }
.locked-panel-title { font-family: var(--serif); font-size: 28px; font-weight: 600; }
.locked-panel-copy { color: var(--muted); font-size: 14px; }
.locked-unlock-btn { min-width: 140px; height: 44px; justify-content: center; margin-top: 12px; }
/* 与工作区分离的密码弹窗：取消/关闭只收起弹窗，笔记本仍停留在锁定态。 */
.unlock-backdrop {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  padding: 16px; background: rgba(31, 28, 43, .2); backdrop-filter: blur(2px); overflow-y: auto;
}
.unlock-modal {
  position: relative; display: grid; gap: 0; width: min(460px, 100%); padding: 30px;
  margin: auto; border: 1px solid var(--border); border-radius: 16px; background: var(--surface);
  box-shadow: 0 18px 56px rgba(25, 21, 40, .16); outline: none;
}
.unlock-modal-icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 20px;
}
.unlock-modal-close {
  position: absolute; top: 91px; right: 25px; width: 34px; height: 34px; display: grid; place-items: center;
  padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.unlock-modal-close:hover { background: var(--surface-2); color: var(--text); }
.unlock-modal .unlock-title { font-family: inherit; font-size: 21px; font-weight: 650; margin-bottom: 16px; }
.unlock-description { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; }
.unlock-form { display: grid; gap: 14px; }
.unlock-password-field { gap: 7px; }
.unlock-password-field > label, .unlock-otp > label { font-size: 13px; font-weight: 600; }
.unlock-input-wrap { position: relative; display: flex; align-items: center; border-radius: 11px; }
.unlock-input-wrap:focus-within { box-shadow: 0 0 0 3px var(--accent-soft); }
.unlock-password { height: 52px; padding: 0 48px 0 13px; border-radius: 10px; background: var(--surface); }
.unlock-input-wrap:focus-within .unlock-password { border-color: var(--accent); }
.unlock-reveal {
  position: absolute; right: 8px; width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer;
}
.unlock-reveal:hover { color: var(--text); background: var(--surface-2); }
.unlock-reveal:disabled { opacity: .5; cursor: not-allowed; }
.unlock-otp { margin-top: 2px; }
.unlock-error { color: var(--danger); font-size: 12.5px; }
.unlock-error:empty { display: none; }
.unlock-actions { margin-top: 4px; }
.unlock-actions .btn { min-width: 74px; justify-content: center; }
.unlock-actions .btn-primary { min-width: 105px; }
.unlock-form .progress { margin-bottom: 2px; }

/* ------------------------------- 未保存草稿 ------------------------------- */
.doc-body-draft { display: flex; flex-direction: column; }
.doc-body-draft .doc-panes { flex: 1; min-height: 0; }
.doc-body-draft .doc-editor { min-height: 0; height: 100%; }
.draft-hint {
  display: flex; align-items: center; gap: 12px; margin-top: auto; padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  border-radius: 12px; background: color-mix(in srgb, var(--accent-soft) 52%, var(--surface));
  color: var(--muted); font-size: 13px; line-height: 1.55;
}
.draft-hint-icon {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border-radius: 10px; background: var(--surface); color: var(--accent);
}
.draft-hint-copy { display: grid; gap: 2px; }
.draft-hint-copy strong { color: var(--text); font-size: 13px; }
.draft-hint-copy span { display: block; }
.link-button {
  appearance: none; border: 0; padding: 0; background: transparent; color: var(--accent);
  font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.unlock-help { margin: -2px 0 4px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.unlock-note {
  margin: 4px 0 0; padding: 11px 13px; border-radius: 9px;
  background: var(--accent-soft); color: var(--muted); font-size: 12px; line-height: 1.6;
}
.draft-save-modal { width: min(560px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; }
.draft-save-modal .unlock-form { gap: 7px; }
.draft-save-modal .field { gap: 7px; }
.draft-save-modal .unlock-actions { margin-top: 18px; }

/* ---- 专注模式：只留正文，横向居中 ---- */
.nb[data-focus="true"] .nb-side { display: none; }
.nb[data-focus="true"] .doc-body { padding-left: max(28px, calc((100% - 800px) / 2)); padding-right: max(28px, calc((100% - 800px) / 2)); }
.drawer-backdrop { display: none; }
.nb[data-focus="true"] .hintbar { opacity: .3; }

/* ==========================================================================
   移动端（≤900px）：抽屉式侧栏 + 参考站同款顶栏/卡片留白/正文字号
   ========================================================================== */
@media (max-width: 900px) {
  /* ---- 外壳与安全区 ---- */
  .nb { padding-top: env(safe-area-inset-top); }

  /* ---- 侧栏抽屉 ---- */
  .nb-side {
    position: fixed; inset: 0 auto 0 0; width: min(300px, calc(100vw - 40px)); z-index: 30;
    padding: max(24px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-bottom));
    transform: translateX(-101%); transition: transform .22s cubic-bezier(.22, .61, .36, 1);
    box-shadow: none; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  }
  .nb[data-drawer="open"] .nb-side { transform: translateX(0); box-shadow: 10px 0 50px rgba(28, 24, 43, .13); }
  .nb-side > * { flex: none; }
  .brand { height: 62px; }
  .side-close {
    display: inline-flex; position: absolute; right: max(10px, env(safe-area-inset-right));
    top: max(10px, env(safe-area-inset-top)); width: 40px; height: 40px; align-items: center; justify-content: center;
    appearance: none; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer;
  }
  .side-close:hover { background: var(--surface-2); color: var(--text); }
  .drawer-backdrop {
    display: block; position: fixed; inset: 0; z-index: 25; appearance: none; border: 0; padding: 0;
    background: rgba(28, 24, 43, .42); opacity: 0; pointer-events: none; transition: opacity .22s ease;
  }
  .nb[data-drawer="open"] .drawer-backdrop { opacity: 1; pointer-events: auto; }

  /* ---- 主区与顶栏 ---- */
  .nb-main { padding: 0 6px; }
  .nb-back { display: inline-flex; }
  .nb-top { height: auto; min-height: 60px; padding: 8px 6px; gap: 6px; }
  .nb-top > .grow { display: none; }
  .crumbs { gap: 5px; font-size: 13px; }
  .crumbs .crumb-muted, .crumbs > svg { display: none; }
  .crumb-current { font-size: 14px; }
  .nb-top-unlocked {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto;
    align-items: center; align-content: center; gap: 2px 8px; padding: 10px 6px 6px; margin-right: 0;
  }
  .nb-top-unlocked .crumbs { grid-column: 2; grid-row: 1; min-width: 0; }
  .nb-top-unlocked .top-actions { grid-column: 3; grid-row: 1; gap: 4px; }
  .nb-top-unlocked .top-divider { display: none; }
  .nb-top-unlocked .top-actions .btn-icon { width: 40px; height: 40px; }
  .nb-top-unlocked .top-actions .btn-primary { height: 42px; padding: 0 14px; font-size: 13px; gap: 6px; }
  .nb-top-unlocked .top-actions .btn-primary svg { width: 17px; height: 17px; }
  .nb-top-unlocked .save-hint { grid-column: 1 / -1; grid-row: 2; font-size: 12px; line-height: 1.5; }
  .nb-top .crumbs { flex: 1; min-width: 0; }
  .nb-top .locked-status { display: none; }
  .nb-top .locked-top-lock { border-left: 0; }
  .nb-top .locked-save { height: 42px; padding: 0 14px; font-size: 13px; }

  /* ---- 卡片与工具栏 ---- */
  .doc-card { margin-bottom: 0; border-radius: 12px; box-shadow: 0 4px 18px rgba(48, 35, 77, .05); }
  .doc-toolbar { min-height: 55px; padding: 0 12px; gap: 8px; }
  .doc-toolbar .toolbar-right { margin-left: auto; gap: 0; flex: none; }
  .doc-toolbar-locked { overflow: hidden; }
  /* 与参考站一致：小屏隐藏「专注」，只保留「更多」。
     注意 more 按钮同时带了 focus-btn 类，必须排除它。 */
  .focus-btn:not(.toolbar-more-btn) { display: none; }
  .toolbar-more-btn { width: 40px; height: 40px; }

  /* ---- 正文排版 ---- */
  .doc-body { padding: 20px 18px 20px; }
  .doc-head { gap: 10px; padding-bottom: 14px; margin-bottom: 12px; }
  .doc-meta-line { gap: 8px; font-size: 11.5px; }
  .doc-head, .doc-panes[data-view="edit"], .doc-panes[data-view="preview"] { max-width: none; }
  .doc-title { font-size: 25px; }
  .doc-editor, .preview { line-height: 1.85; }
  .doc-editor { min-height: 50vh; }
  .doc-panes { gap: 16px; }
  .doc-panes[data-view="split"] { grid-template-columns: 1fr; }
  .doc-panes[data-view="split"] .doc-editor { border-right: none; padding-right: 0; }

  /* ---- 状态栏与底部提示 ---- */
  .doc-status { min-height: 40px; padding: 8px 14px; gap: 5px 12px; font-size: 11.5px; }
  .hintbar { height: calc(34px + env(safe-area-inset-bottom)); padding: 0 8px env(safe-area-inset-bottom); font-size: 11px; }
  .hintbar kbd, .hintbar .hint-label { display: none; }
  .stat-encrypt { display: none; }

  /* ---- 触控目标与输入字号（防止 iOS 聚焦缩放） ---- */
  .input, .search-input, .doc-tags-input { font-size: 16px; }
  .side-action, .side-add, .side-link, .recent-item { min-height: 44px; }
  .side-search { height: 44px; }

  /* ---- 弹窗 ---- */
  .locked-doc-body { padding: 18px; }
  .locked-panel { padding: 16px; }
  .unlock-modal { padding: 26px 22px 22px; }
  .unlock-modal-close { top: 85px; right: 16px; }
}

@media (max-width: 400px) {
  .nb-top-unlocked .top-actions .btn-primary { padding: 0 11px; }
  .doc-body { padding-left: 15px; padding-right: 15px; }
}

/* ---- 强度提示（名字 / 密码） ---- */
.strength-hint { display: flex; align-items: baseline; gap: 7px; font-size: 12px; line-height: 1.55; color: var(--muted); }
.strength-hint[data-level="weak"] .strength-level { color: var(--danger); }
.strength-hint[data-level="fair"] .strength-level { color: var(--warn); }
.strength-hint[data-level="strong"] .strength-level { color: var(--ok); }
.strength-level { font-weight: 600; flex: none; }
.strength-reason { min-width: 0; }
.name-suggest { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---- 本地 2FA 工具与使用指南 ---- */
.totp-box { display: grid; gap: 4px; justify-items: center; padding: 16px; background: var(--surface-2); border-radius: 12px; }
.totp-code { font-family: var(--mono); font-size: 30px; letter-spacing: .16em; font-weight: 600; color: var(--accent-strong); }
.help-step { display: grid; gap: 4px; }
.help-step h4 { font-size: 14px; }
.kbd-list { display: grid; gap: 7px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.kbd-list span { display: flex; align-items: center; gap: 8px; }
/* ------------------------------- 对话框 ------------------------------- */
.backdrop {
  /* 55 而不是 40：保存草稿的弹窗是 z-index 50，确认框必须能盖在它上面 */
  position: fixed; inset: 0; background: rgba(8, 8, 18, .5); z-index: 55;
  display: grid; place-items: center; padding: 18px; overflow-y: auto;
}
.dialog {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px; width: 100%; max-width: 480px; box-shadow: var(--shadow);
  display: grid; gap: 16px; margin: auto;
}
.dialog h2 { font-size: 18px; }
.dialog-rows { display: grid; gap: 14px; }
.dialog-row { display: grid; gap: 6px; }
.dialog-row .label { font-size: 13px; color: var(--muted); }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.secret {
  font-family: var(--mono); font-size: 13px; background: var(--surface-2);
  padding: 10px 12px; border-radius: 8px; overflow-wrap: anywhere; user-select: all;
}

/* ------------------------------- 提示条 ------------------------------- */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(94vw, 520px); }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; box-shadow: var(--shadow); font-size: 13.5px;
  display: flex; gap: 9px; align-items: center;
}
.toast-danger { border-color: color-mix(in srgb, var(--danger) 50%, var(--border)); color: var(--danger); }
.toast-ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
/* ------------------------------- 小工具类 -------------------------------
   严格 CSP（style-src 'self'，无 'unsafe-inline'）下，元素的 style="" 内联属性会被拦掉，
   因此所有零星样式都必须落成类名，这里集中定义。 */
.entry-row-spaced { margin-top: 10px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.dialog-actions-left { justify-content: flex-start; }
.inline-warn { margin: 12px 20px 0; }

/* ---------------------------- 生物识别解锁 ---------------------------- */
.unlock-biometric-row { margin-bottom: 10px; }
.unlock-biometric-btn { width: 100%; justify-content: center; gap: 8px; }
.unlock-biometric-enable {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 2px 0 6px; font-size: 12.5px; line-height: 1.5;
  color: var(--muted); cursor: pointer;
}
.unlock-biometric-check {
  width: 15px; height: 15px; margin: 1px 0 0; flex: none;
  accent-color: var(--accent);
}
/* ---------------------- 侧边栏：最近打开（草稿页） ---------------------- */
.recent-panel {
  display: grid; gap: 1px; margin: 0 0 10px; padding: 0 2px;
  border: 0; background: transparent;
}
.recent-head {
  display: flex; align-items: center; gap: 8px; padding: 3px 8px 5px;
  font-size: 11.5px; color: var(--muted);
}
.recent-head .link-button { font-size: 11.5px; white-space: nowrap; }
.recent-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 9px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); font: inherit; font-size: 12.5px;
  text-align: left; cursor: pointer;
}
.recent-item:hover { background: var(--surface-2); }
.recent-item svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.recent-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-time { flex: none; font-size: 11px; color: var(--muted); }
/* ---------------------------- 首页选择器 ---------------------------- */
.home-backdrop {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; padding: 18px; overflow-y: auto;
  background: rgba(8, 8, 18, .40);
  backdrop-filter: blur(14px) saturate(115%);
  -webkit-backdrop-filter: blur(14px) saturate(115%);
}
.home-chooser {
  width: 100%; max-width: 420px; margin: auto; padding: 22px;
  border-radius: 18px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .26);
}
.home-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.home-mark { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.home-brand-text { display: grid; gap: 2px; min-width: 0; }
.home-brand-text strong { font-size: 18px; }
.home-brand-text span { font-size: 12.5px; color: var(--muted); }
.home-actions { display: grid; gap: 8px; }
.home-action {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 14.5px; text-align: left; cursor: pointer;
}
.home-action:hover { border-color: color-mix(in srgb, var(--accent) 42%, transparent); }
.home-action > svg { color: var(--muted); flex: none; }
.home-action-primary { border-color: transparent; background: var(--accent); color: #fff; }
.home-action-primary:hover { background: var(--accent-strong); }
.home-action-primary > svg { color: rgba(255, 255, 255, .85); }
.home-action-icon {
  display: grid; place-items: center; width: 30px; height: 30px; flex: none;
  border-radius: 9px; background: rgba(128, 128, 160, .14);
}
.home-action-primary .home-action-icon { background: rgba(255, 255, 255, .18); }
.home-action-label { flex: 1; min-width: 0; }
.home-foot { margin: 16px 2px 0; font-size: 12px; color: var(--muted); }
.home-subhead { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.home-subhead h2 { font-size: 17px; }
.home-back {
  display: grid; place-items: center; width: 30px; height: 30px; flex: none;
  border-radius: 8px; border: 1px solid transparent; background: transparent;
  color: var(--muted); cursor: pointer;
}
.home-back:hover { background: var(--surface-2); color: var(--text); }
.home-tip { margin: 0 0 12px; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.home-empty {
  margin: 4px 0 12px; padding: 14px; border-radius: 10px;
  background: var(--surface-2); color: var(--muted); font-size: 13px;
}
.home-recent-list { display: grid; gap: 6px; max-height: 46vh; overflow-y: auto; margin-bottom: 10px; }
.home-recent-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 12px; border-radius: 10px; border: 1px solid transparent;
  background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 13.5px; text-align: left; cursor: pointer;
}
.home-recent-item:hover { border-color: color-mix(in srgb, var(--accent) 42%, transparent); }
.home-recent-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-recent-time { flex: none; font-size: 11.5px; color: var(--muted); }
.home-link {
  justify-self: start; padding: 0; border: 0; background: transparent;
  color: var(--accent); font: inherit; font-size: 13px;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
@media (max-width: 560px) {
  .home-chooser { padding: 18px; border-radius: 16px; }
  .home-recent-list { max-height: 40vh; }
}