:root {
  --bg-page: #f6f8fa;
  --bg-sidebar: #ffffff;
  --bg-content: #ffffff;
  --bg-hover: #f0f2f5;
  --bg-active: #e8f0fe;
  --bg-reader: #ffffff;
  --bg-code: #eff1f3;
  --bg-search-panel: #ffffff;
  --bg-snippet: #f9fafb;
  --border: #d0d7de;
  --border-light: #e3e8ec;
  --text-primary: #1f2328;
  --text-secondary: #656d76;
  --text-muted: #8b949e;
  --accent: #0969da;
  --accent-hover: #0550ae;
  --accent-bg: #ddf4ff;
  --highlight: #fff8c5;
  --green: #1a7f37;
  --orange: #bc4c00;
  --red: #cf222e;
  --radius: 8px;
  --radius-sm: 5px;
  --sidebar-w: 260px;
  --search-panel-w: 340px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  overflow: hidden;
  font-size: 14px;
}

/* ── Layout: 3-column ── */
.app { display: flex; height: 100vh; }

/* ── Left Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  z-index: 20;
}
.sidebar-header {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border-light);
}
.sidebar-header h1 {
  font-size: 15px; font-weight: 650;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-primary);
}
.logo-icon {
  width: 26px; height: 26px;
  background: linear-gradient(135deg, var(--accent), #6cb6ff);
  border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(9,105,218,0.3);
}
.subtitle {
  font-size: 11px; color: var(--text-muted);
  margin-top: 3px; letter-spacing: 0.3px;
}

/* ── Search Box ── */
.search-box {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  position: relative;
}
.search-box input {
  width: 100%;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px 8px 34px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238b949e' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
}
.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(9,105,218,0.12);
  background-color: var(--bg-content);
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box .clear-btn {
  position: absolute; right: 22px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 4px;
  display: none; font-size: 16px; line-height: 1;
}
.search-box .clear-btn:hover { color: var(--text-primary); }
.search-box.has-text .clear-btn { display: block; }

/* ── File List ── */
.file-list { flex: 1; overflow-y: auto; padding: 6px; }
.file-list::-webkit-scrollbar { width: 5px; }
.file-list::-webkit-scrollbar-track { background: transparent; }
.file-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.file-list::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.tree-folder {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 8px;
  padding-left: calc(8px + var(--depth, 0) * 14px);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  user-select: none;
  transition: background .1s, color .1s;
}
.tree-folder:hover { background: var(--bg-hover); color: var(--text-primary); }
.tree-folder .chevron {
  width: 9px; height: 9px; flex-shrink: 0;
  transition: transform .12s ease;
  color: var(--text-muted);
}
.tree-folder.collapsed .chevron { transform: rotate(-90deg); }
.tree-folder .folder-icon {
  width: 14px; height: 14px; flex-shrink: 0;
  color: var(--accent);
}
.tree-folder .folder-name {
  flex: 1; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis;
}
.tree-folder.collapsed + .tree-children { display: none; }
.file-item {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 10px;
  padding-left: calc(10px + var(--depth, 0) * 14px);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  transition: background .1s;
}
.file-item:hover { background: var(--bg-hover); }
.file-item.active {
  background: var(--bg-active);
  color: var(--accent-hover);
  font-weight: 550;
}
.file-icon {
  width: 15px; height: 15px; flex-shrink: 0;
  opacity: 0.55;
}
.file-item.active .file-icon { opacity: 1; }
.file-name {
  flex: 1; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis;
}
.file-badge {
  font-size: 10px; color: var(--text-muted);
  background: var(--bg-page);
  border-radius: 8px; padding: 1px 6px;
  flex-shrink: 0;
}

/* ── Right Search Panel ── */
.search-panel {
  width: var(--search-panel-w);
  background: var(--bg-search-panel);
  border-right: 1px solid var(--border);
  display: none;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 15;
}
.search-panel.visible { display: flex; }

.search-panel-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.search-panel-header h3 {
  font-size: 13px; font-weight: 650; color: var(--text-primary);
}
.search-panel-header .count-badge {
  font-size: 11px; color: var(--accent);
  background: var(--accent-bg);
  border-radius: 10px; padding: 2px 8px;
  font-weight: 600;
}

.search-results { flex: 1; overflow-y: auto; padding: 8px; }
.search-results::-webkit-scrollbar { width: 5px; }
.search-results::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.result-card {
  background: var(--bg-snippet);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.result-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.result-card-header {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 6px;
}
.result-card .doc-title {
  font-size: 13px; font-weight: 600;
  color: var(--accent);
  flex: 1; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis;
}
.result-card .doc-path-mini {
  font-size: 10px; color: var(--text-muted);
}
.snippet {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 6px 8px;
  background: var(--bg-content);
  border-radius: 4px;
  margin-top: 4px;
  border-left: 2px solid var(--border);
  font-family: "SFMono-Regular", Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.snippet .line-num {
  color: var(--text-muted);
  font-size: 10px;
  margin-right: 6px;
}
.snippet mark {
  background: var(--highlight);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
  font-weight: 600;
}
.snippet:hover { border-left-color: var(--accent); }

.search-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Main Content ── */
.content {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--bg-content);
}
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 24px;
  min-height: 48px;
  flex-wrap: wrap; row-gap: 6px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.topbar .breadcrumb {
  flex: 1; font-size: 13px; color: var(--text-secondary);
}
.topbar .breadcrumb .sep { margin: 0 5px; color: var(--text-muted); }
.topbar .breadcrumb .current { color: var(--text-primary); font-weight: 550; }
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 11px;
  color: var(--text-primary);
  font-size: 12px; cursor: pointer;
  text-decoration: none;
  transition: background .12s;
}
.btn:hover { background: var(--bg-hover); }
.btn svg { width: 13px; height: 13px; }
.btn.busy { pointer-events: none; opacity: 0.6; }
.btn .mini-spinner {
  display: inline-block; width: 13px; height: 13px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  vertical-align: -2px;
}

/* ── Reader ── */
.reader {
  flex: 1; overflow-y: auto;
  background: var(--bg-page);
  scroll-behavior: smooth;
}
.reader::-webkit-scrollbar { width: 8px; }
.reader::-webkit-scrollbar-track { background: var(--bg-page); }
.reader::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.reader::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.reader-inner {
  max-width: 860px;
  margin: 28px auto 48px;
  padding: 52px 64px 88px;
  background: var(--bg-reader);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 32px rgba(0,0,0,.07);
}
/* 空状态 / 密码门时不做纸张化 */
.reader-inner:has(.empty-state), .reader-inner:has(.resume-gate) {
  background: transparent; box-shadow: none; border-radius: 0;
  margin: 0 auto; padding: 40px 48px 120px;
}

/* 占位符高亮: [请替换] 等未替换内容, 防止带占位符分享事故 */
#mdContent .ph-warn {
  background: repeating-linear-gradient(45deg, #fff3cd, #fff3cd 4px, #ffe69c 4px, #ffe69c 8px);
  border-bottom: 2px wavy #dc3545;
  border-radius: 3px; padding: 0 2px;
  outline: 1px dashed rgba(220,53,69,.45); outline-offset: 1px;
}

/* ── Markdown Styles (GitHub Light) ── */
.markdown-body { font-size: 15px; line-height: 1.7; color: var(--text-primary); }
.markdown-body h1 { font-size: 26px; font-weight: 700; letter-spacing: 0.2px; margin: 36px 0 18px; padding-bottom: 10px; border-bottom: 2px solid var(--border); }
.markdown-body h2 { font-size: 18px; font-weight: 650; margin: 30px 0 14px; padding-bottom: 7px; border-bottom: 1px solid var(--border-light); }
.markdown-body h3 { font-size: 15.5px; font-weight: 650; margin: 22px 0 10px; }
.markdown-body h4 { font-size: 14px; font-weight: 600; margin: 20px 0 8px; color: var(--text-secondary); }
.markdown-body p { margin: 0 0 12px; }
.markdown-body a { color: var(--accent); text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }
.markdown-body ul, .markdown-body ol { margin: 0 0 12px; padding-left: 28px; }
.markdown-body li { margin: 5px 0; line-height: 1.65; }
.markdown-body blockquote {
  margin: 0 0 12px; padding: 6px 16px;
  border-left: 3px solid var(--border);
  background: var(--bg-page);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}
.markdown-body code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88em;
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-primary);
}
.markdown-body pre {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
  margin: 0 0 16px;
  position: relative;
}
.markdown-body pre code {
  background: none; padding: 0; color: var(--text-primary);
  font-size: 13px; line-height: 1.5;
}
.markdown-body table {
  border-collapse: collapse; width: 100%; margin: 0 0 16px;
  display: block; overflow-x: auto;
}
.markdown-body table th, .markdown-body table td {
  border: 1px solid var(--border);
  padding: 8px 14px; text-align: left;
}
.markdown-body table th {
  background: var(--bg-page); font-weight: 600; font-size: 13px;
}
.markdown-body table tr:nth-child(even) { background: rgba(0,0,0,0.015); }
.markdown-body hr { border: none; border-top: 1px solid var(--border-light); margin: 24px 0; }
.markdown-body img { max-width: 100%; border-radius: var(--radius-sm); margin: 8px 0; }
.markdown-body input[type="checkbox"] { margin-right: 6px; accent-color: var(--green); }

/* highlight target line */
.highlight-target {
  animation: highlight-pulse 2.5s ease-out;
  border-radius: var(--radius-sm);
}
@keyframes highlight-pulse {
  0%   { background: var(--highlight); box-shadow: 0 0 0 4px var(--highlight); }
  50%  { background: var(--highlight); }
  100% { background: transparent; box-shadow: none; }
}

/* ── In-document keyword highlight (from search) ── */
.markdown-body mark.search-mark {
  background: var(--highlight);
  color: inherit;
  border-radius: 2px;
  padding: 0 2px;
  font-weight: 600;
}
.markdown-body mark.search-mark.first-match {
  animation: flash-highlight 2.5s ease-out;
}
@keyframes flash-highlight {
  0%, 30% { background: #ffd54f; box-shadow: 0 0 0 3px rgba(255,213,79,0.4); }
  100%     { background: var(--highlight); box-shadow: none; }
}

/* ── XLSX Sheet Tabs ── */
.sheet-tabs {
  display: flex; gap: 0; flex-wrap: wrap;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px; overflow-x: auto;
}
.sheet-tab {
  padding: 8px 16px;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border: none; background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color .12s, border-color .12s;
}
.sheet-tab:hover { color: var(--accent); }
.sheet-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.sheet-tab .tab-count {
  font-size: 11px; color: var(--text-muted);
  background: var(--bg-page);
  border-radius: 8px; padding: 1px 6px;
  margin-left: 4px;
}

/* ── XLSX Data Table ── */
.xlsx-viewer { margin-top: 8px; }

/* ── Plain Text Document (SSH keys / .txt / .pem etc.) ── */
.text-doc-wrap {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-content);
  overflow: auto;
  max-height: 75vh;
}
.text-doc-pre {
  margin: 0;
  padding: 14px 18px;
  font-family: ui-monospace, SFMono-Regular, "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-primary);
  tab-size: 4;
}
.text-doc-pre code { font-family: inherit; background: transparent; padding: 0; }
.xlsx-table-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  max-height: 70vh;
  background: var(--bg-content);
}
.xlsx-table-wrapper::-webkit-scrollbar { width: 6px; height: 6px; }
.xlsx-table-wrapper::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.xlsx-table {
  border-collapse: collapse;
  font-size: 13px; width: 100%;
}
.xlsx-table th, .xlsx-table td {
  border: 1px solid var(--border-light);
  padding: 6px 10px;
  text-align: left;
  white-space: nowrap;
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xlsx-table thead th {
  background: var(--bg-page);
  font-weight: 600;
  color: var(--text-primary);
  position: sticky; top: 0; z-index: 1;
}
.xlsx-table tbody tr:nth-child(even) { background: rgba(0,0,0,0.015); }
.xlsx-table tbody tr:hover { background: var(--bg-active); }
.xlsx-table .row-num {
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
  background: var(--bg-page);
  position: sticky; left: 0; z-index: 1;
  width: 40px; min-width: 40px;
}
.xlsx-table thead .row-num {
  position: sticky; top: 0; left: 0; z-index: 2;
}
.xlsx-table td.cell-empty { color: var(--text-muted); }
.xlsx-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ── Copy Button ── */
.copy-btn {
  position: absolute; top: 8px; right: 8px;
  background: var(--bg-content); border: 1px solid var(--border);
  border-radius: 4px; padding: 3px 8px;
  font-size: 11px; color: var(--text-secondary);
  cursor: pointer; opacity: 0; transition: opacity .15s;
}
pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--text-primary); }

/* ── Empty State ── */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%; text-align: center; color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; opacity: 0.2; }
.empty-state h2 { font-size: 18px; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
.empty-state p { font-size: 13px; }

/* ── Loading ── */
.loading-overlay {
  position: fixed; inset: 0; background: var(--bg-page);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.loading-overlay.hidden { display: none; }
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-primary); color: var(--bg-content);
  border-radius: var(--radius); padding: 10px 20px;
  font-size: 13px; z-index: 10000; opacity: 0;
  transition: transform .3s, opacity .3s;
  box-shadow: var(--shadow-md);
}

/* ── Password Gate ── */
.auth-overlay {
  position: fixed; inset: 0; background: var(--bg-page);
  display: flex; align-items: center; justify-content: center;
  z-index: 99999;
}
.auth-card {
  background: var(--bg-content); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px 36px; width: 340px;
  box-shadow: var(--shadow-md); text-align: center;
}
.auth-card .lock-icon {
  width: 48px; height: 48px; margin: 0 auto 16px;
  background: var(--accent-bg); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.auth-card h2 { font-size: 17px; font-weight: 650; margin-bottom: 6px; }
.auth-card p { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.auth-card input {
  width: 100%; padding: 10px 14px; font-size: 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  outline: none; text-align: center; letter-spacing: 2px;
  transition: border-color .15s, box-shadow .15s;
}
.auth-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.auth-card .auth-error {
  color: var(--red); font-size: 12px; margin-top: 10px;
  min-height: 16px; display: none;
}
.auth-card button {
  width: 100%; margin-top: 16px; padding: 10px;
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: background .15s;
}
.auth-card button:hover { background: var(--accent-hover); }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  :root { --search-panel-w: 300px; }
}
@media (max-width: 900px) {
  .search-panel { display: none !important; }
}

/* ── 移动端抽屉侧栏 (≤768px): 默认收起, 汉堡按钮开关 ── */
.sidebar-burger {
  display: none;
  position: fixed; left: 14px; top: 12px; z-index: 130;
  width: 40px; height: 40px; border-radius: 12px; border: 0.5px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 4px 16px rgba(0,0,0,.12), 0 1px 3px rgba(0,0,0,.06);
  color: #1f2328; cursor: pointer;
  align-items: center; justify-content: center;
  transition: transform .15s ease, opacity .15s;
}
.sidebar-burger svg { width: 20px; height: 20px; }
.sidebar-burger:active { transform: scale(.92); }
.sidebar-mask {
  display: none;
  position: fixed; inset: 0; z-index: 110;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .2s ease;
}
@media (max-width: 768px) {
  :root { --sidebar-w: min(78vw, 300px); }
  .sidebar-burger { display: flex; }
  /* 抽屉态: 侧栏移出屏幕外, body.sidebar-open 时滑入 */
  .sidebar {
    position: fixed; z-index: 120; height: 100%;
    transform: translateX(-102%);
    transition: transform .22s ease;
    box-shadow: 8px 0 32px rgba(0,0,0,.15);
    will-change: transform;
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-mask { display: block; opacity: 1; }
  /* 侧栏滑出时汉堡随之隐藏, 防重叠 */
  body.sidebar-open .sidebar-burger { opacity: 0; pointer-events: none; }
  .reader-inner { padding: 24px 18px 80px; margin: 20px auto 40px; }
  .topbar { padding: 6px 12px 6px 62px; }   /* 左侧给汉堡按钮留位 */
  .topbar .breadcrumb { font-size: 12px; }
  .tpl-select-btn { max-width: 120px; }
  #tplCurrentName { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
}

/* ═══════════ ResumeHub: 简历模板系统 ═══════════ */

/* ── 模板通用基础设施 ── */
#mdContent h1, #mdContent h2, #mdContent h3 { break-after: avoid-page; }
#mdContent li, #mdContent tr { break-inside: avoid; }
#mdContent .res-block {
  list-style: none; padding: 10px 14px; margin-bottom: 12px;
  border-radius: 8px; border: 1px solid var(--border-light);
  background: var(--bg-snippet);
}
#mdContent .res-block > p:first-child { margin-top: 0; margin-bottom: 6px; }
#mdContent .res-block > p:first-child + li { margin-top: 0; }
#mdContent .res-block li:last-child { margin-bottom: 0; }

/* ── 极简黑白简历样式（唯一模板, 全局默认） ── */
#mdContent {
  font-family: "Helvetica Neue", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #000;
}
#mdContent h1 { font-size: 24px; border-bottom: 3px double #000; text-align: center; letter-spacing: 1px; }
#mdContent h2 { font-size: 14px; border-bottom: 1px solid #999; color: #000; margin: 22px 0 10px; }
#mdContent h3 { font-size: 13.5px; margin: 14px 0 6px; }
#mdContent a { color: #000; text-decoration: underline; }
#mdContent strong { font-weight: 700; }
#mdContent hr { border: none; border-top: 1px solid #ddd; }
#mdContent blockquote { border-left: 3px solid #777; background: #f7f7f7; color: #222; }
#mdContent ul li::marker { color: #000; }

/* ── 右侧竖向悬浮操作按钮 ── */
.fab-dock {
  position: fixed; right: 22px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 12px; z-index: 250;
}
.fab {
  width: 52px; height: 52px; border-radius: 16px; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 0.5px solid rgba(0,0,0,.08);
  box-shadow: 0 4px 16px rgba(0,0,0,.12), 0 1px 3px rgba(0,0,0,.06);
  color: #1f2328; transition: transform .15s ease, box-shadow .15s ease, opacity .15s;
}
.fab svg { width: 19px; height: 19px; }
.fab span { font-size: 9px; font-weight: 600; letter-spacing: .3px; }
.fab:hover { transform: scale(1.07); box-shadow: 0 6px 22px rgba(0,0,0,.16), 0 2px 5px rgba(0,0,0,.08); }
.fab:active { transform: scale(.96); }
.fab.busy { pointer-events: none; opacity: .55; }
@media (max-width: 768px) {
  .fab-dock { right: 12px; }
  .fab { width: 46px; height: 46px; border-radius: 14px; }
  .fab svg { width: 17px; height: 17px; }
}
@media print {
  .fab-dock { display: none !important; }
}

/* ── 分享管理面板 ── */
.share-card { width: 480px; max-height: 82vh; display: flex; flex-direction: column; }
.share-create label { display: block; }
.share-create input[type=text] { width: 100%; }
.share-targets { margin-top: 10px; max-height: 110px; overflow-y: auto; }
.share-target-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.share-target-item { font-size: 12px; color: var(--text-primary); background: var(--bg-snippet);
  border: 1px solid var(--border-light); border-radius: 6px; padding: 4px 8px; margin-bottom: 3px; }
.share-divider { height: 1px; background: var(--border-light); margin: 16px 0 10px; }
.share-history-title { font-size: 12px; font-weight: 650; color: var(--text-secondary); margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.share-filter-tabs { display: inline-flex; background: var(--bg-hover); border-radius: 7px; padding: 2px; }
.share-filter-tabs .sft { border: none; background: transparent; font-size: 11px; color: var(--text-secondary);
  padding: 3px 9px; border-radius: 5px; cursor: pointer; transition: all .12s; }
.share-filter-tabs .sft.active { background: var(--bg-content); color: var(--accent); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.share-item-files { font-size: 10px; color: var(--text-muted); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-list { overflow-y: auto; flex: 1; }
.share-empty { text-align: center; color: var(--text-muted); font-size: 12px; padding: 18px 0; }
.share-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--border-light);
  border-radius: 8px; margin-bottom: 6px; background: var(--bg-snippet); }
.share-item-main { flex: 1; min-width: 0; }
.share-item-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.share-item-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.share-item-link { font-size: 11px; color: var(--accent); cursor: pointer; margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-item-link:hover { text-decoration: underline; }
.share-del { border: none; background: transparent; color: var(--text-muted); cursor: pointer;
  font-size: 14px; padding: 6px; border-radius: 6px; flex-shrink: 0; }
.share-del:hover { color: var(--red); background: rgba(207,34,46,.08); }

/* ── 右键菜单 ── */
.ctx-menu { position: fixed; z-index: 600; min-width: 180px; background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--border-light); border-radius: 10px; padding: 5px;
  box-shadow: 0 10px 40px rgba(0,0,0,.16), 0 2px 8px rgba(0,0,0,.08); }
.ctx-item { padding: 7px 12px; font-size: 13px; color: var(--text-primary); cursor: pointer;
  border-radius: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-item:hover { background: var(--accent-bg); color: var(--accent-hover); }

/* ── 打印优化：A4 输出 ── */
@media print {
  @page { size: A4; margin: 12mm 13mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html, body { background: #fff !important; }
  .sidebar, .topbar, .search-panel, .tpl-select, .zoom-ctrl, .copy-btn, .toast, .admin-panel { display: none !important; }
  .reader { overflow: visible !important; background: #fff !important; }
  .reader-inner { margin: 0 auto !important; max-width: 100% !important; padding: 0 !important; background: #fff !important; box-shadow: none !important; border-radius: 0 !important; }
  .markdown-body { font-size: 12.5px !important; line-height: 1.55 !important; }
  #mdContent { zoom: 1 !important; }
  .markdown-body h1 { font-size: 20px !important; margin: 16px 0 10px !important; }
  .markdown-body h2 { font-size: 15px !important; margin: 14px 0 8px !important; }
  .markdown-body h3 { font-size: 13.5px !important; margin: 12px 0 6px !important; }
  .markdown-body p { margin: 0 0 8px !important; }
  .markdown-body li { margin: 2px 0 !important; }
  #mdContent ul { border: none !important; background: transparent !important; box-shadow: none !important; padding-left: 22px !important; margin-bottom: 8px !important; }
  #mdContent ul > p:first-child { display: inline; }
  #mdContent ul > p:first-child + li, #mdContent ul > li:first-child { margin-top: 0 !important; }
  #mdContent .res-block { background: transparent !important; border: none !important; box-shadow: none !important; padding: 0 !important; break-inside: avoid; }
  .markdown-body a { color: #000 !important; text-decoration: none !important; }
  #mdContent li::marker { color: #000 !important; }
}

/* ── 单简历密码门 ── */
.resume-gate {
  max-width: 420px; margin: 10vh auto; text-align: center;
  background: var(--bg-content); border-radius: 16px; padding: 40px 36px;
  box-shadow: var(--shadow-md);
}
.resume-gate .icon { font-size: 44px; margin-bottom: 12px; }
.resume-gate h2 { font-size: 18px; margin-bottom: 6px; }
.resume-gate p { color: var(--text-secondary); font-size: 13px; margin-bottom: 24px; }
.resume-gate input {
  width: 100%; box-sizing: border-box; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 8px; font-size: 15px;
  text-align: center; letter-spacing: 2px; outline: none;
}
.resume-gate input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.resume-gate button {
  width: 100%; margin-top: 14px; padding: 12px; border: none; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 15px; cursor: pointer;
}
.resume-gate button:hover { background: var(--accent-hover); }
.resume-gate .err { color: var(--red); font-size: 13px; margin-top: 10px; display: none; }

/* ── 管理员密码面板 ── */
.admin-panel {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 300;
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.admin-panel .card {
  width: 400px; background: var(--bg-content); border-radius: 14px;
  padding: 28px; box-shadow: var(--shadow-md);
}
.admin-panel h3 { font-size: 16px; margin-bottom: 4px; }
.admin-panel .sub { font-size: 12px; color: var(--text-secondary); margin-bottom: 18px; }
.admin-panel label { display: block; font-size: 12px; color: var(--text-secondary); margin: 12px 0 4px; }
.admin-panel input {
  width: 100%; box-sizing: border-box; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 7px; font-size: 14px; outline: none;
}
.admin-panel input:focus { border-color: var(--accent); }
.admin-panel .row { display: flex; gap: 10px; margin-top: 20px; }
.admin-panel button { flex: 1; padding: 10px; border-radius: 8px; border: none; cursor: pointer; font-size: 14px; }
.admin-panel .ok { background: var(--accent); color: #fff; }
.admin-panel .cancel { background: var(--bg-hover); color: var(--text-primary); }
