/* notes.300042.cn — 单页样式 */
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --border: #e3e6ea;
  --text: #2c3e50;
  --text-dim: #8a94a0;
  --accent: #3478f6;
  --accent-soft: #eaf1fe;
  --danger: #e5484d;
  --radius: 8px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181d;
    --panel: #1f232a;
    --border: #31363f;
    --text: #d7dce2;
    --text-dim: #7d8794;
    --accent: #5b95f9;
    --accent-soft: #26314a;
  }
  .vditor { --panel-background: var(--panel) !important; }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
.hidden { display: none !important; }
.spacer { flex: 1; }

/* ---------- 登录 ---------- */
.login-view {
  height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #3b6fd4 0%, #6a4fb3 100%);
}
.login-card {
  width: 320px; padding: 36px 32px; border-radius: 14px;
  background: var(--panel); text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.login-card h1 { margin: 0 0 4px; font-size: 24px; }
.login-sub { margin: 0 0 24px; color: var(--text-dim); font-size: 13px; }
.btn {
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  border-radius: var(--radius); padding: 8px 14px; font-size: 14px; cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; width: 100%; }
.btn-primary:hover { opacity: .9; color: #fff; }
.btn-bark { width: 100%; padding: 11px; font-size: 15px; font-weight: 500; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.bark-hint { font-size: 13px; color: #2e9e5b; margin: 12px 0 0; }
.login-divider {
  margin: 20px 0; display: flex; align-items: center; color: var(--text-dim); font-size: 12px;
}
.login-divider::before, .login-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.login-divider span { padding: 0 12px; }
.pw-form { display: flex; flex-direction: column; gap: 10px; }
.remember-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-dim); text-align: left;
}
.remember-label input { accent-color: var(--accent); }
.input {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 9px 12px; font-size: 14px; background: var(--bg); color: var(--text);
  outline: none;
}
.input:focus { border-color: var(--accent); }
.login-err { color: var(--danger); font-size: 13px; margin: 12px 0 0; }

/* ---------- 布局 ---------- */
.app { height: 100%; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 8px 14px;
  background: var(--panel); border-bottom: 1px solid var(--border);
}
.logo { font-weight: 600; white-space: nowrap; }
.icon-btn {
  border: none; background: none; font-size: 17px; cursor: pointer;
  color: var(--text); padding: 4px 6px; border-radius: 6px;
}
.icon-btn:hover { background: var(--accent-soft); }
.body { flex: 1; display: flex; min-height: 0; }
.sidebar {
  width: 250px; min-width: 250px; background: var(--panel);
  border-right: 1px solid var(--border); overflow: auto;
  display: flex; flex-direction: column; padding: 10px 8px;
}
.sidebar-actions { display: flex; gap: 6px; margin-bottom: 8px; }
.sidebar-actions .btn { flex: 1; }

/* 搜索 */
.search-wrap { position: relative; flex: 1; max-width: 460px; }
.search-input {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 7px 12px; font-size: 13px; background: var(--bg); color: var(--text); outline: none;
}
.search-input:focus { border-color: var(--accent); }
.search-results {
  position: absolute; top: 38px; left: 0; right: 0; max-height: 65vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 60;
}
.sr-item { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: var(--accent-soft); }
.sr-item .sr-name { font-weight: 500; }
.sr-item .sr-path { color: var(--text-dim); font-size: 12px; margin-left: 6px; }
.sr-item .sr-snippet { color: var(--text-dim); font-size: 12px; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-item mark { background: #ffe58a; color: inherit; border-radius: 2px; }
.sr-empty { padding: 14px; color: var(--text-dim); text-align: center; }

/* 目录树 */
.tree { flex: 1; overflow: auto; user-select: none; }
.tree-item {
  display: flex; align-items: center; gap: 5px; padding: 4px 8px;
  border-radius: 6px; cursor: pointer; white-space: nowrap; overflow: hidden;
}
.tree-item:hover { background: var(--accent-soft); }
.tree-item.active { background: var(--accent); color: #fff; }
.tree-item .t-icon { flex-shrink: 0; font-size: 13px; }
.tree-item .t-name { overflow: hidden; text-overflow: ellipsis; }
.tree-children { margin-left: 14px; border-left: 1px solid var(--border); padding-left: 4px; }

/* 编辑区 */
.editor-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.editor-meta {
  display: flex; align-items: center; gap: 12px; padding: 6px 14px;
  background: var(--panel); border-bottom: 1px solid var(--border); font-size: 12px;
}
.meta-path { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-time { color: var(--text-dim); white-space: nowrap; }
.save-state { color: var(--text-dim); }
.editor { flex: 1; min-height: 0; }
.vditor { height: 100%; border: none; }
.empty-hint {
  flex: 1; display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 15px;
}

/* 右键菜单 */
.ctx-menu {
  position: fixed; z-index: 100; min-width: 120px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 4px;
}
.ctx-menu button {
  display: block; width: 100%; text-align: left; border: none; background: none;
  padding: 7px 12px; font-size: 13px; cursor: pointer; border-radius: 5px; color: var(--text);
}
.ctx-menu button:hover { background: var(--accent-soft); }
.ctx-menu button.danger { color: var(--danger); }

/* 移动端 */
@media (max-width: 760px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 50;
    box-shadow: 4px 0 16px rgba(0,0,0,.2);
  }
  .sidebar.collapsed { display: none; }
  .logo { display: none; }
}
