/* ============================================================
   LaTeX Studio — Overleaf 风格界面样式
   ============================================================ */
:root {
  --bg: #1c1e21;
  --bg-2: #24272b;
  --bg-3: #2b2f34;
  --panel: #202327;
  --border: #363b42;
  --border-soft: #2e3339;
  --text: #e6e8eb;
  --text-dim: #a3aab2;
  --text-faint: #6f7780;
  --accent: #4ea1ff;
  --accent-2: #2f7fe0;
  --green: #4ec9a0;
  --amber: #e5b567;
  --red: #e57373;
  --purple: #b48ead;
  --paper: #ffffff;
  --paper-text: #1a1a1a;
  --col-tree: 250px;
  --col-preview: 50%;
  --header-h: 52px;
  --shadow: 0 6px 24px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  font-size: 14px;
}
button { font-family: inherit; cursor: pointer; }
a { color: var(--accent); }

/* ---------- 顶栏 ---------- */
.topbar {
  height: var(--header-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  z-index: 30;
  position: relative;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; letter-spacing: .2px; white-space: nowrap; }
.brand .logo {
  width: 28px; height: 28px; border-radius: 7px;
  background: linear-gradient(135deg, #4ea1ff, #7d5cff);
  display: grid; place-items: center; font-family: Georgia, serif; font-style: italic;
  font-size: 17px; color: #fff; font-weight: 700;
}
.brand small { color: var(--text-faint); font-weight: 500; font-size: 11px; }
.top-divider { width: 1px; height: 24px; background: var(--border); margin: 0 2px; }

.project-title {
  background: transparent; border: 1px solid transparent; color: var(--text);
  font-size: 15px; font-weight: 600; padding: 5px 9px; border-radius: 6px;
  min-width: 120px; max-width: 260px;
}
.project-title:hover { border-color: var(--border); }
.project-title:focus { outline: none; border-color: var(--accent); background: var(--bg-3); }

.sync-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-dim);
  padding: 4px 10px; border-radius: 20px; background: var(--bg-3);
  white-space: nowrap;
}
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); transition: background .2s; }
.sync-chip.saving .sync-dot { background: var(--amber); animation: pulse 1s infinite; }
.sync-chip.error .sync-dot { background: var(--red); }
.sync-chip.offline .sync-dot { background: var(--text-faint); }
@keyframes pulse { 50% { opacity: .35; } }

.spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-3); color: var(--text);
  border: 1px solid var(--border); border-radius: 7px;
  padding: 7px 12px; font-size: 13px; font-weight: 500;
  transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover { background: #343941; border-color: #4a5058; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn-primary:hover { background: #3a90ee; border-color: #3a90ee; }
.btn-compile { background: linear-gradient(135deg, #2f7fe0, #4ea1ff); border: none; color: #fff; font-weight: 600; padding: 7px 16px; }
.btn-compile:hover { filter: brightness(1.1); }
.btn-icon { padding: 7px 9px; }
.btn .ic { font-size: 14px; line-height: 1; }

/* ---------- 主体三栏 ---------- */
.workspace { display: flex; height: calc(100% - var(--header-h)); position: relative; }

/* 文件树侧栏 */
.sidebar {
  width: var(--col-tree); min-width: var(--col-tree);
  background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
  transition: width .2s, min-width .2s;
}
.sidebar.collapsed { width: 0; min-width: 0; border-right: none; }
.side-head {
  height: 42px; min-height: 42px; display: flex; align-items: center;
  padding: 0 12px; border-bottom: 1px solid var(--border-soft);
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-faint);
  font-weight: 700;
}
.side-head .spacer { flex: 1; }
.side-head button { background: none; border: none; color: var(--text-dim); font-size: 15px; padding: 2px 5px; border-radius: 4px; }
.side-head button:hover { background: var(--bg-3); color: var(--text); }

.file-tree { flex: 1; overflow-y: auto; padding: 6px 0; }
.file-row {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 12px; cursor: pointer; font-size: 13px;
  border-left: 2px solid transparent; user-select: none;
}
.file-row:hover { background: var(--bg-3); }
.file-row.active { background: #263444; border-left-color: var(--accent); color: #fff; }
.file-row .ficon { font-size: 14px; width: 16px; text-align: center; }
.file-row .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .factions { display: none; gap: 2px; }
.file-row:hover .factions { display: flex; }
.file-row .factions button { background: none; border: none; color: var(--text-dim); padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.file-row .factions button:hover { background: var(--bg); color: var(--text); }
.file-row .badge-main { font-size: 9px; background: var(--accent-2); color: #fff; padding: 1px 5px; border-radius: 8px; }
.tree-empty { padding: 20px 12px; color: var(--text-faint); font-size: 12px; text-align: center; line-height: 1.6; }

.side-foot { border-top: 1px solid var(--border-soft); padding: 8px; display: flex; gap: 6px; }
.side-foot .btn { flex: 1; justify-content: center; font-size: 12px; padding: 6px; }

/* 编辑 / 预览区 */
.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.editor-row { flex: 1; display: flex; min-height: 0; position: relative; }

.pane { position: relative; min-width: 0; display: flex; flex-direction: column; }
.pane-editor { flex: 1; }
.pane-preview { width: var(--col-preview); border-left: 1px solid var(--border); background: #181a1d; }
.pane-preview.collapsed { width: 0; border-left: none; }

.pane-bar {
  height: 38px; min-height: 38px; display: flex; align-items: center; gap: 8px;
  padding: 0 12px; background: var(--bg-2); border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-dim);
}
.pane-bar .file-label { font-weight: 600; color: var(--text); }
.pane-bar .spacer { flex: 1; }
.pane-bar button { background: none; border: none; color: var(--text-dim); padding: 3px 6px; border-radius: 4px; font-size: 12px; }
.pane-bar button:hover { background: var(--bg-3); color: var(--text); }

.editor-host { flex: 1; min-height: 0; overflow: hidden; }
.CodeMirror { height: 100%; font-size: 14px; line-height: 1.55; }
.CodeMirror-gutters { background: var(--bg-2) !important; border-right: 1px solid var(--border-soft) !important; }
.CodeMirror-linenumber { color: var(--text-faint) !important; }
.CodeMirror-activeline-background { background: rgba(255,255,255,.035) !important; }
.cm-s-material-darker .CodeMirror-activeline-background { background: rgba(255,255,255,.035) !important; }

/* 拖拽分隔条 */
.splitter { width: 5px; cursor: col-resize; background: var(--border-soft); z-index: 5; flex-shrink: 0; }
.splitter:hover, .splitter.dragging { background: var(--accent); }

/* 预览纸张 */
.preview-scroll { flex: 1; overflow-y: auto; padding: 26px 18px 60px; background: #181a1d; }
.paper {
  background: var(--paper); color: var(--paper-text);
  width: 100%; max-width: 760px; margin: 0 auto;
  min-height: 1000px; padding: 60px 64px 80px;
  box-shadow: var(--shadow); border-radius: 2px;
  font-family: "Times New Roman", Georgia, "Songti SC", "SimSun", serif;
  font-size: 15px; line-height: 1.75;
  word-wrap: break-word;
}
.paper.light-font { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; }
.lp-p { margin: 0 0 12px; text-align: justify; }
.lp-titleblock { text-align: center; margin: 10px 0 34px; }
.lp-title { font-size: 26px; font-weight: 700; margin: 0 0 14px; }
.lp-author { font-size: 15px; margin-bottom: 6px; }
.lp-date { font-size: 13px; color: #555; }
.lp-chapter { font-size: 22px; font-weight: 700; margin: 28px 0 14px; border-bottom: 2px solid #333; padding-bottom: 6px; }
.lp-section { font-size: 19px; font-weight: 700; margin: 26px 0 12px; }
.lp-subsection { font-size: 16px; font-weight: 700; margin: 20px 0 10px; }
.lp-subsubsection { font-size: 15px; font-weight: 700; margin: 16px 0 8px; font-style: italic; }
.lp-paragraph { font-weight: 700; margin: 12px 0 6px; }
.lp-list { margin: 10px 0 14px; padding-left: 30px; }
.lp-list li { margin: 4px 0; }
.lp-list .lp-list { margin: 4px 0; }
.lp-table { border-collapse: collapse; margin: 14px auto; font-size: 14px; }
.lp-table th, .lp-table td { border: 1px solid #666; padding: 6px 12px; text-align: left; }
.lp-table th { background: #f0f0f0; font-weight: 700; }
.lp-figure { margin: 18px 0; text-align: center; }
.lp-figure-placeholder, .lp-graphic-big {
  display: block; border: 1px dashed #aaa; background: #fafafa;
  padding: 36px; color: #888; font-size: 13px;
}
.lp-graphic { background: #f0f0f0; border: 1px solid #ccc; padding: 1px 6px; border-radius: 3px; font-size: 12px; color: #555; }
.lp-caption { font-size: 13px; color: #444; margin-top: 8px; }
.lp-math-display { position: relative; margin: 16px 0; text-align: center; overflow-x: auto; }
.lp-eqno { position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 13px; }
.lp-math-error { background: #ffe0e0; color: #900; padding: 2px 4px; font-family: monospace; }
.lp-code { background: #f2f2f2; padding: 1px 5px; border-radius: 3px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; }
.lp-verbatim { background: #f6f6f6; border: 1px solid #ddd; border-radius: 4px; padding: 12px 14px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12.5px; line-height: 1.5; overflow-x: auto; margin: 12px 0; white-space: pre-wrap; }
.lp-link { color: #0645ad; text-decoration: underline; }
.lp-ref, .lp-cite { color: #0645ad; }
.lp-footnote { font-size: 10px; vertical-align: super; }
.lp-hr { border: none; border-top: 1px solid #999; margin: 18px 0; }

/* ---------- 底部控制台 ---------- */
.console {
  height: 0; min-height: 0; background: var(--bg-2); border-top: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden; transition: height .18s;
}
.console.open { height: 190px; }
.console-head {
  height: 34px; min-height: 34px; display: flex; align-items: center; gap: 10px;
  padding: 0 12px; font-size: 12px; color: var(--text-dim);
  border-bottom: 1px solid var(--border-soft); cursor: pointer; user-select: none;
}
.console-head .spacer { flex: 1; }
.console-head .toggle { font-size: 14px; transition: transform .18s; }
.console.open .console-head .toggle { transform: rotate(180deg); }
.console-body { flex: 1; overflow-y: auto; padding: 10px 14px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; line-height: 1.65; }
.log-line { white-space: pre-wrap; }
.log-info { color: var(--text-dim); }
.log-ok { color: var(--green); }
.log-warn { color: var(--amber); }
.log-err { color: var(--red); }
.log-cmd { color: var(--accent); }
.log-time { color: var(--text-faint); }

/* ---------- 模态框 ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.overlay.show { display: flex; }
.modal {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  width: 100%; max-width: 620px; max-height: 82vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow); overflow: hidden;
}
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head .spacer { flex: 1; }
.modal-head .x { background: none; border: none; color: var(--text-dim); font-size: 20px; line-height: 1; }
.modal-head .x:hover { color: var(--text); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 7px; padding: 9px 11px; font-size: 14px; font-family: inherit;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field .hint { font-size: 11px; color: var(--text-faint); margin-top: 5px; line-height: 1.5; }

.project-list { display: flex; flex-direction: column; gap: 6px; }
.project-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.project-item:hover { background: var(--bg-3); border-color: #4a5058; }
.project-item .pdoc { font-size: 20px; }
.project-item .pinfo { flex: 1; min-width: 0; }
.project-item .pname { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-item .pmeta { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.project-item .pdel { background: none; border: none; color: var(--text-faint); font-size: 15px; padding: 4px 8px; border-radius: 4px; }
.project-item .pdel:hover { background: rgba(229,115,115,.15); color: var(--red); }

.version-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 7px; margin-bottom: 6px; }
.version-item .vinfo { flex: 1; }
.version-item .vlabel { font-size: 13px; font-weight: 600; }
.version-item .vmeta { font-size: 11px; color: var(--text-faint); }
.version-item .btn { font-size: 11px; padding: 5px 9px; }

/* Toast */
.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #2b3037; border: 1px solid var(--border); color: var(--text);
  padding: 10px 18px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow);
  animation: toastIn .25s ease; display: flex; align-items: center; gap: 8px;
}
.toast.ok { border-color: var(--green); }
.toast.err { border-color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* 确认框 */
.confirm-box { text-align: center; padding: 8px 4px 4px; }
.confirm-box .cicon { font-size: 34px; }
.confirm-box p { color: var(--text-dim); line-height: 1.6; margin: 10px 0 0; }

/* 空状态 */
.empty-state { display: grid; place-items: center; height: 100%; text-align: center; color: var(--text-faint); }
.empty-state .big { font-size: 44px; margin-bottom: 12px; }
.empty-state h2 { color: var(--text); font-size: 18px; margin: 0 0 8px; }
.empty-state p { margin: 0 0 18px; font-size: 13px; }

/* 响应式 */
@media (max-width: 900px) {
  :root { --col-tree: 200px; }
  .brand small { display: none; }
  .btn span.label { display: none; }
  .pane-preview { width: 46%; }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3a4048; border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #4a515a; background-clip: padding-box; }

/* ============================================================
   浅色主题
   ============================================================ */
html[data-theme="light"] {
  --bg: #f5f6f8;
  --bg-2: #ffffff;
  --bg-3: #eef0f3;
  --panel: #ffffff;
  --border: #d9dde2;
  --border-soft: #e6e9ed;
  --text: #2a2f36;
  --text-dim: #5d6672;
  --text-faint: #9aa2ac;
  --accent: #2f7fe0;
  --accent-2: #2f7fe0;
  --shadow: 0 6px 24px rgba(0,0,0,.12);
}
html[data-theme="light"] .btn { background: #eef0f3; }
html[data-theme="light"] .btn:hover { background: #e2e6ea; border-color: #c4cad1; }
html[data-theme="light"] .sync-chip { background: #eef0f3; }
html[data-theme="light"] .file-row.active { background: #dceafb; color: #1a4a85; }
html[data-theme="light"] .pane-preview { background: #e9ebee; }
html[data-theme="light"] .preview-scroll { background: #e9ebee; }
html[data-theme="light"] .CodeMirror-gutters { background: #f7f8fa !important; }
html[data-theme="light"] .console { background: #ffffff; }
html[data-theme="light"] .toast { background: #ffffff; color: #2a2f36; }
html[data-theme="light"] .project-item:hover { background: #f2f5f8; }

/* ============================================================
   账号 / 图片资源 / 登录
   ============================================================ */
.user-btn { max-width: 150px; }
.user-btn #userName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot { flex-wrap: wrap; }
.side-foot .btn { min-width: 46%; }

/* 图片资源列表 */
.image-list { display: flex; flex-direction: column; gap: 8px; }
.image-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.image-thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; background: var(--bg-3); flex-shrink: 0; }
.image-info { flex: 1; min-width: 0; }
.image-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-meta { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.image-item .btn { font-size: 11px; padding: 5px 8px; }

/* 登录 / 注册 */
.auth-tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.auth-tab { background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-dim); padding: 8px 12px; font-size: 13px; font-weight: 600; }
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.hint { font-size: 11px; color: var(--text-faint); line-height: 1.6; }
.user-card { background: var(--bg-3); border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.user-card .uname { font-size: 16px; font-weight: 700; }
.user-card .umail { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.user-card .ubadge { display: inline-block; font-size: 10px; background: var(--accent-2); color: #fff; padding: 2px 7px; border-radius: 8px; margin-top: 9px; }

/* 预览中的真实图片 */
.lp-img { max-width: 100%; height: auto; display: block; margin: 10px auto; border: 1px solid #ddd; border-radius: 2px; }
.lp-figure .lp-img { background: #fff; padding: 0; color: inherit; border: 1px solid #ddd; }
.lp-graphic.lp-img { display: inline-block; max-width: 100%; margin: 0; vertical-align: middle; }

/* 窄屏时用户按钮只显示头像 */
@media (max-width: 1100px) {
  .user-btn #userName { display: none; }
  .user-btn { padding: 7px 9px; }
}

/* ============================================================
   论文模板库
   ============================================================ */
.modal-wide { max-width: 980px; height: 82vh; }
.tpl-total { font-size: 11px; color: var(--text-faint); margin-right: 8px; }
.tpl-body { padding: 14px 20px 20px; }
.tpl-toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.tpl-search, .tpl-toolbar select {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 10px 12px; font-size: 13px; font-family: inherit;
}
.tpl-search { flex: 1; min-width: 0; }
.tpl-toolbar select { width: 200px; cursor: pointer; }
.tpl-search:focus, .tpl-toolbar select:focus { outline: none; border-color: var(--accent); }
.tpl-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tpl-cat {
  background: var(--bg-3); border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 20px; padding: 5px 13px; font-size: 12px; cursor: pointer; transition: all .15s;
}
.tpl-cat:hover { border-color: var(--accent); color: var(--text); }
.tpl-cat.active { background: var(--accent-2); border-color: var(--accent-2); color: #fff; font-weight: 600; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 10px; }
.tpl-card {
  background: var(--bg-2); border: 1px solid var(--border); border-left: 4px solid var(--tpl-accent, var(--accent));
  border-radius: 9px; padding: 12px 13px; display: flex; flex-direction: column;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.tpl-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 6px 18px rgba(0,0,0,.16); }
.tpl-card-top { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.tpl-school { font-size: 10px; font-weight: 700; color: #fff; background: var(--tpl-accent, var(--accent)); padding: 2px 8px; border-radius: 9px; }
.tpl-level { font-size: 10px; color: var(--text-faint); border: 1px solid var(--border); padding: 2px 7px; border-radius: 9px; }
.tpl-name { font-size: 14.5px; font-weight: 700; line-height: 1.35; }
.tpl-desc { font-size: 11.5px; color: var(--text-dim); line-height: 1.55; margin-top: 6px; min-height: 36px; }
.tpl-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.tpl-tag { font-size: 10px; color: var(--text-faint); background: var(--bg-3); border-radius: 4px; padding: 2px 6px; }
.tpl-card-foot { display: flex; align-items: center; gap: 6px; margin-top: 11px; }
.tpl-card-foot .btn { font-size: 11px; padding: 5px 9px; }
.tpl-files { flex: 1; font-size: 10px; color: var(--text-faint); }
.tpl-back { margin-bottom: 12px; font-size: 12px; }
.tpl-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tpl-preview-head h4 { margin: 0; font-size: 16px; }
.tpl-pv-meta { font-size: 11px; color: var(--text-faint); margin-top: 5px; }
.tpl-filetabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 9px; }
.tpl-filetab {
  background: var(--bg-3); border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 6px; padding: 5px 10px; font-size: 11px; cursor: pointer;
}
.tpl-filetab.active { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.tpl-code {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 14px;
  font-family: Consolas, Monaco, "Courier New", monospace; font-size: 12px; line-height: 1.6;
  color: var(--text); overflow: auto; max-height: 46vh; white-space: pre; margin: 0;
}

/* 摘要 / 关键词（论文模板预览） */
.lp-abstract { border: 1px solid var(--border); border-radius: 6px; padding: 12px 16px; margin: 14px 0; background: var(--bg-2); }
.lp-abstract-title { text-align: center; font-weight: 700; font-size: 14px; letter-spacing: 2px; margin-bottom: 8px; color: var(--text); }
.lp-abstract p { margin: 0; font-size: 13px; line-height: 1.75; text-align: justify; }
.lp-keywords { margin-top: 9px; font-size: 12px; color: var(--text-dim); }
