/* ============ 基础 ============ */
:root{
  --page-w: 794px;        /* 由 JS 覆盖 */
  --page-h: 1123px;
  --pad-x: 76px;
  --pad-y: 76px;
  --body-fs: 14.5px;

  --bg: #f4f5f7;
  --surface: #ffffff;
  --line: #e4e7ec;
  --line-soft: #eef0f3;
  --text: #1f2328;
  --text-2: #57606a;
  --text-3: #8b949e;
  --accent: #1f6feb;
  --accent-ink: #111827;

  --ink: #1f2328;
  --ink-2: #424a53;
  --ink-3: #6e7781;
  --rule: #d8dee4;
  --soft: #f6f8fa;
  --link: #1a4f9c;
  --code-bg: #f6f8fa;
  --code-fg: #24292f;
  --code-line: #e6e9ec;
  --ln: #b7bfc8;
}

*{ box-sizing: border-box; }

/* 必须放在所有组件样式之前/之上：作者样式会覆盖 UA 的 [hidden]{display:none} */
[hidden]{ display: none !important; }

html, body{
  height: 100%;
  margin: 0;
}

body{
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ============ 顶栏 ============ */
.topbar{
  position: sticky;
  top: 0;
  flex: 0 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 10px -6px rgba(16,24,40,.10);
  z-index: 70;   /* 高于菜单(60)，吸顶时下拉不被内容盖住 */
}

.brand{ display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo-link{ display: block; text-decoration: none; }
.logo-link:hover .logo{ background: #1f2937; }
.logo{
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font: 700 15px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.brand-text{ display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong{ font-size: 14px; font-weight: 600; letter-spacing: .2px; }
.brand-sub{ font-size: 11.5px; color: var(--text-3); }

.topbar-meta{
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.actions{ display: flex; align-items: center; gap: 8px; }

.btn{
  height: 32px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn:hover{ background: #f7f8fa; border-color: #d3d8e0; }
.btn.ghost{ color: var(--text-2); }
.btn.primary{
  background: #111827;
  border-color: #111827;
  color: #fff;
  font-weight: 500;
}
.btn.primary:hover{ background: #1f2937; border-color: #1f2937; }
.btn.block{ width: 100%; margin-top: 10px; }

.icon-btn{
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 0; background: transparent; border-radius: 6px;
  font-size: 20px; line-height: 1; color: var(--text-3); cursor: pointer;
}
.icon-btn:hover{ background: #f2f4f6; color: var(--text); }

/* ============ 工作区 ============ */
.workspace{
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 42% 6px 1fr;
}
.splitter{ cursor: col-resize; background: transparent; position: relative; }
.splitter::after{
  content: ""; position: absolute; inset: 0 2px;
  background: var(--line);
}
.splitter:hover::after{ background: var(--accent); }

.pane{
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  position: relative;
}
.pane-head{
  flex: 0 0 auto;
  height: 34px;
  display: flex; align-items: center; gap: 7px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--text-2);
  background: #fcfcfd;
  transition: box-shadow .18s ease;
}
/* 内容从面板头下方滚过时给出层次，静止时保持干净 */
.pane-head.scrolled{
  box-shadow: 0 6px 12px -8px rgba(16,24,40,.24);
  border-bottom-color: var(--line);
}
.dot{ width: 6px; height: 6px; border-radius: 50%; background: #c9ced6; }
.dot.ok{ background: #2da44e; }
.pane-hint{ margin-left: auto; color: var(--text-3); }

/* 编辑器 */
#editor{
  flex: 1 1 auto;
  width: 100%;
  border: 0; outline: 0; resize: none;
  padding: 16px 18px 40px;
  font: 13.5px/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #24292f;
  tab-size: 2;
}
#editor::placeholder{ color: #b6bdc6; }

.drop-mask{
  position: absolute; inset: 34px 8px 8px;
  display: none;
  place-items: center;
  border: 2px dashed var(--accent);
  border-radius: 10px;
  background: rgba(31,111,235,.05);
  color: var(--accent);
  font-size: 13px;
  pointer-events: none;
}
.pane-editor.dragging .drop-mask{ display: grid; }

/* 预览 */
.preview-scroll{
  flex: 1 1 auto;
  overflow: auto;
  padding: 26px 20px 60px;
  background: #eceef1;
}
.pages-zoom{ transform-origin: top left; }
.pages{ display: flex; flex-direction: column; }

/* ============ 纸张 ============ */
.page{
  position: relative;
  width: var(--page-w);
  min-height: var(--page-h);
  margin: 0 auto 22px;
  padding: var(--pad-y) var(--pad-x);
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 10px 26px rgba(16,24,40,.10);
}
.page:last-child{ margin-bottom: 8px; }

.page-head, .page-foot{
  position: absolute;
  left: var(--pad-x); right: var(--pad-x);
  height: calc(var(--pad-y) * .5);
  display: flex; align-items: center;
  font-size: 9.5px;
  color: #8a919b;
  letter-spacing: .3px;
  overflow: hidden;
  white-space: nowrap;
}
.page-head{ top: calc(var(--pad-y) * .22); }
.page-foot{ bottom: calc(var(--pad-y) * .22); justify-content: center; }
.page-head span{ overflow: hidden; text-overflow: ellipsis; }
.page-foot .num{ font-variant-numeric: tabular-nums; }

/* ============ Markdown 排版 ============ */
/* 单页内容容器：建立 BFC，避免外边距折叠影响分页测量 */
.md-body-part{ display: flow-root; }
.md-body-part > :first-child{ margin-top: 0 !important; }
.md-body-part > :last-child{ margin-bottom: 0 !important; }

.md-body{
  font-size: var(--body-fs);
  line-height: 1.75;
  color: var(--ink);
  word-wrap: break-word;
}
.md-body > :first-child{ margin-top: 0 !important; }
.md-body > :last-child{ margin-bottom: 0 !important; }

.md-body h1, .md-body h2, .md-body h3,
.md-body h4, .md-body h5, .md-body h6{
  margin: 1.5em 0 .6em;
  font-weight: 650;
  line-height: 1.35;
  color: #10161d;
}
.md-body h1{ font-size: 1.62em; margin-top: 0; padding-bottom: .3em; border-bottom: 1px solid var(--rule); }
.md-body h2{ font-size: 1.32em; padding-bottom: .25em; border-bottom: 1px solid #eaeef2; }
.md-body h3{ font-size: 1.13em; }
.md-body h4{ font-size: 1em; }
.md-body h5, .md-body h6{ font-size: .92em; color: var(--ink-2); }

.md-body p{ margin: .72em 0; }
.md-body strong{ font-weight: 650; color: #0d1117; }
.md-body em{ font-style: italic; }
.md-body del{ color: var(--ink-3); }

.md-body a{ color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
body.hide-urls .md-body a::after{ content: none !important; }
body.show-urls .md-body a[href^="http"]::after{
  content: " ⟨" attr(href) "⟩";
  font-size: .84em; color: var(--ink-3); font-weight: 400;
}
body.show-urls .md-body a{ text-decoration: none; border-bottom: 1px solid rgba(26,79,156,.35); }

.md-body ul, .md-body ol{ margin: .7em 0; padding-left: 1.5em; }
.md-body li{ margin: .22em 0; }
.md-body li > ul, .md-body li > ol{ margin: .18em 0; }
.md-body ul.contains-task-list{ list-style: none; padding-left: 1.25em; }
.md-body .task-list-item input{ margin-right: .35em; }
.md-body ol ol{ list-style: lower-alpha; }

.md-body blockquote{
  margin: .9em 0;
  padding: .1em 0 .1em 1em;
  border-left: 3px solid #cfd6dd;
  color: var(--ink-2);
}
.md-body blockquote p{ margin: .4em 0; }

.md-body hr{
  height: 1px; margin: 1.6em 0;
  border: 0; background: var(--rule);
}

code.md-inline{
  padding: .12em .38em;
  border-radius: 4px;
  background: var(--soft);
  border: 1px solid var(--code-line);
  font: .88em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #2a3138;
}

.md-body table{
  width: 100%;
  max-width: 100%;
  margin: 1em 0;
  border-collapse: collapse;
  font-size: .94em;
  table-layout: auto;
}
.md-body th, .md-body td{
  border: 1px solid var(--code-line);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.md-body th{ background: var(--soft); font-weight: 620; color: #10161d; }
.md-body tbody tr:nth-child(even) td{ background: #fcfcfd; }

.md-body img{ max-width: 100%; }

/* 代码块 */
.md-body pre{
  margin: 1em 0;
  padding: 10px 12px;
  border: 1px solid var(--code-line);
  border-radius: 6px;
  background: var(--code-bg);
  overflow: visible;
}
.md-body pre code.hljs{
  display: block;
  padding: 0;
  background: transparent;
  font: .855em/1.62 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--code-fg);
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
}
.md-ln{ display: block; min-height: 1.62em; }
.md-ln-no{
  display: none;
  width: 3.2em;
  margin-right: .6em;
  text-align: right;
  color: var(--ln);
  user-select: none;
}
body.with-ln .md-ln-no{ display: inline-block; }
body.with-ln .md-ln{ padding-left: 3.8em; text-indent: -3.8em; }
.md-lc{ display: inline; }

/* 目录 */
.md-body .md-toc{ margin: 0 0 1.4em; }
.md-body .md-toc-title{
  font-size: 1.32em; font-weight: 650;
  margin: 0 0 .6em; padding-bottom: .25em;
  border-bottom: 1px solid var(--rule);
}
.toc-item{
  display: flex; align-items: baseline; gap: .4em;
  font-size: .97em;
  margin: .18em 0;
}
.toc-item a{ color: var(--ink); text-decoration: none; }
.toc-item a:hover{ text-decoration: underline; }
.toc-item .dots{
  flex: 1 1 auto;
  border-bottom: 1px dotted #c6ccd3;
  transform: translateY(-3px);
  min-width: 1.2em;
}
.toc-item .pg{ font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: .92em; }
.toc-h2{ padding-left: 1.1em; }
.toc-h3{ padding-left: 2.2em; }
.toc-h2, .toc-h3{ font-size: .93em; color: var(--ink-2); }

/* ============ 主题 ============ */
body.theme-code .md-body pre{
  background: #0d1117;
  border-color: #0d1117;
}
body.theme-code .md-body pre code.hljs{ color: #e6edf3; }
body.theme-code .md-ln-no{ color: #4d5866; }

body:not(.show-urls) .md-body a{ color: #143a70; }

/* ============ 设置抽屉 ============ */
.scrim{
  position: fixed; inset: 0;
  background: rgba(16,24,40,.22);
  z-index: 40;
}
.drawer{
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 330px;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -8px 0 30px rgba(16,24,40,.10);
  transform: translateX(101%);
  transition: transform .22s cubic-bezier(.3,.7,.3,1);
  z-index: 50;
  display: flex; flex-direction: column;
}
.drawer.open{ transform: none; }
.drawer-head{
  flex: 0 0 auto;
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--line-soft);
}
.drawer-body{ flex: 1 1 auto; overflow: auto; padding: 6px 18px 24px; }

.group{ padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.group:last-child{ border-bottom: 0; }
.group h4{
  margin: 0 0 10px;
  font-size: 11px; font-weight: 600;
  letter-spacing: .8px; text-transform: uppercase;
  color: var(--text-3);
}
.field{
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 6px 0;
  font-size: 13px; color: var(--text-2);
}
.field.col{ flex-direction: column; align-items: stretch; gap: 6px; }
.field input[type="text"]{
  height: 32px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 7px;
  font-size: 13px; color: var(--text); outline: none;
}
.field input[type="text"]:focus{ border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,111,235,.12); }

.seg{
  display: inline-flex;
  padding: 2px;
  background: #f1f3f5;
  border-radius: 8px;
}
.seg button{
  border: 0; background: transparent;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12.5px; color: var(--text-2);
  cursor: pointer;
}
.seg button.active{
  background: #fff; color: var(--text);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(16,24,40,.10);
}

.row{
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 8px 0;
  font-size: 13px; color: var(--text-2);
  cursor: pointer;
}
.sw{
  appearance: none; -webkit-appearance: none;
  position: relative;
  width: 36px; height: 20px;
  border-radius: 10px;
  background: #d3d8de;
  cursor: pointer;
  transition: background .18s;
  flex: 0 0 auto;
  margin: 0;
}
.sw::after{
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.18);
  transition: transform .18s;
}
.sw:checked{ background: #111827; }
.sw:checked::after{ transform: translateX(16px); }

.tips{ margin: 0; padding-left: 18px; color: var(--text-3); font-size: 12px; line-height: 1.75; }
.tips li{ margin: 2px 0; }

/* ============ Pro ============ */
.btn.pro-on{
  background: #eef4ff;
  border-color: #cfe0ff;
  color: #1a4f9c;
  font-weight: 500;
}
.btn.pro-on:hover{ background: #e4eeff; border-color: #bcd4ff; }

.pro-price{
  margin: 8px 0 12px;
  font-size: 22px; font-weight: 620; letter-spacing: -.3px;
}
.pro-price small{ font-size: 12px; font-weight: 400; color: var(--text-3); }
.pro-price .soon{ vertical-align: 3px; margin-left: 6px; }
.soon{
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  background: #f4f6f8;
  border: 1px solid var(--line);
  color: var(--text-3);
  font-size: 11px; font-weight: 400;
}
/* 套餐选择（价格与名称来自一人付 /product，前端不写死金额） */
.pro-plans{ display: grid; gap: 8px; margin: 10px 0 14px; }
.plan-opt{
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; cursor: pointer; text-align: left; font: inherit;
  transition: border-color .15s, background .15s;
}
.plan-opt:hover{ border-color: #c8cfd8; background: #fafbfc; }
.plan-opt.active{ border-color: #1f6feb; background: #f5f9ff; }
.plan-opt b{ font-size: 13.5px; font-weight: 600; color: var(--text); }
.plan-opt span{ font-size: 12.5px; color: var(--text-2); }

/* 购买入口：二维码与跳转链接 */
#pro-entry{ display: grid; gap: 10px; justify-items: center; margin-bottom: 12px; }
.pro-qr{
  width: 168px; height: 168px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}

.pro-list{ margin: 0; padding-left: 18px; }
.pro-list li{ font-size: 13px; line-height: 1.95; color: var(--text-2); }
.pro-list li b{ color: var(--text); }
.pro-fine{ margin: 12px 0 0; font-size: 12px; color: var(--text-3); line-height: 1.7; }

/* 登录弹窗：本地 AUTH_MOCK=1 的演示登录行 */
#auth-mock{
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line);
}
#auth-mock .mock-row{ display: flex; gap: 8px; margin-top: 8px; }
#auth-mock input[type="text"]{
  flex: 1; min-width: 0; height: 32px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 7px;
  font-size: 13px; color: var(--text); outline: none;
}
#auth-mock input[type="text"]:focus{
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,111,235,.12);
}
#auth-mock .pro-fine{ margin-top: 8px; }

/* ============ 导出菜单 ============ */
.menu-wrap{ position: relative; }
.caret{
  display: inline-block;
  margin-left: 4px;
  border: 4px solid transparent;
  border-top-color: currentColor;
  transform: translateY(2px);
  opacity: .75;
}
.menu{
  position: absolute;
  right: 0; top: 38px;
  width: 286px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(16,24,40,.14);
  z-index: 60;
}
.menu button{
  display: block; width: 100%;
  text-align: left;
  border: 0; background: transparent;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  font: inherit;
}
.menu button:hover{ background: #f4f6f8; }
.menu button strong{ display: block; font-size: 13px; font-weight: 550; color: var(--text); }
.menu button em{ display: block; font-style: normal; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.menu-sep{ height: 1px; background: var(--line-soft); margin: 5px 8px; }

/* ============ 用户菜单（右上角头像 + 下拉） ============ */
.user-menu{ margin-left: 2px; }
.avatar-btn{
  width: 32px; height: 32px;
  padding: 0; border: 0; border-radius: 50%;
  background: var(--accent); color: #fff;
  cursor: pointer; overflow: hidden;
  display: inline-grid; place-items: center;
  font-size: 14px; font-weight: 600;
  vertical-align: middle;
  box-shadow: 0 0 0 1px var(--line);
}
.avatar-btn:hover{ box-shadow: 0 0 0 2px var(--accent); }
.avatar-btn img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.user-dropdown{ width: 240px; }
.ud-head{
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 6px;
}
.ud-ava{
  flex: none;
  width: 34px; height: 34px; border-radius: 50%;
  background: #d85a4e; color: #fff;
  display: inline-grid; place-items: center;
  font-size: 14px; font-weight: 600;
  overflow: hidden;
}
.ud-ava img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.ud-id{ min-width: 0; display: grid; }
.ud-id strong{
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ud-id em{ font-style: normal; font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.ud-id em.pro{ color: var(--accent); font-weight: 600; }
.user-dropdown button em:empty{ display: none; }

/* ============ 引导弹层 ============ */
.modal{
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: rgba(16,24,40,.34);
  z-index: 80;
}
.modal-card{
  width: 430px; max-width: calc(100vw - 40px);
  padding: 20px 22px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 22px 54px rgba(16,24,40,.26);
}
.modal-card h3{ margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.modal-card p{ margin: 0; font-size: 13px; color: var(--text-2); }
.modal-card ol{
  margin: 12px 0; padding-left: 20px;
  font-size: 13px; line-height: 1.95; color: var(--text-2);
}
.modal-card ol b{ color: var(--text); font-weight: 600; }
.modal-note{
  margin: 12px 0 0;
  padding: 8px 10px;
  border-radius: 7px;
  background: #fff8e6;
  border: 1px solid #f2dfb0;
  color: #8a5a00;
  font-size: 12px;
  line-height: 1.6;
}
.modal-actions{ display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* 登录弹窗：比通用弹窗窄 15%，垂直方向更舒展 */
#auth-modal .modal-card{ width: 366px; padding: 26px 24px; }
#auth-modal .modal-card h3{ margin-bottom: 12px; }
#auth-modal .modal-note{ margin-top: 14px; }
#auth-modal #auth-providers{ margin-top: 18px; display: flex; justify-content: center; }
#auth-modal #auth-mock{ margin-top: 16px; }
#auth-modal #auth-msg{ margin-top: 12px; }
#auth-modal .modal-actions{ margin-top: 22px; }

/* ============ 语言切换（下拉：语言数量可变，宽度恒定） ============ */
.lang-sel{ display: inline-flex; align-items: center; }
.lang-select{
  height: 30px;
  max-width: 104px;
  padding: 0 22px 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238b949e' d='M0 0h10L5 6z'/%3E%3C/svg%3E") no-repeat right 8px center;
  color: var(--text);
  font-size: 12.5px;
  line-height: 30px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  text-overflow: ellipsis;
}
.lang-select:hover{ border-color: #d3d8e0; background-color: #f7f8fa; }
.lang-select:focus{
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31,111,235,.12);
}

/* ============ 登录弹窗（Google / 演示） ============ */
#auth-providers{ margin-top: 12px; min-height: 40px; display: grid; place-items: center; }
.gsi-holder{ width: 100%; display: grid; place-items: center; }
.google-fallback{ margin-top: 2px; }
#auth-mock{ margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.mock-row{ display: flex; gap: 8px; margin-top: 6px; }
.mock-row .input{
  flex: 1; height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line); border-radius: 7px;
  font-size: 13px; color: var(--text);
  background: #fff;
}
.mock-row .input:focus{ outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,111,235,.12); }

/* 导出进度 */
.progress{ margin-top: 14px; }
.progress .bar{
  height: 6px;
  background: #eceff2;
  border-radius: 4px;
  overflow: hidden;
}
.progress .bar i{
  display: block;
  width: 0; height: 100%;
  background: #111827;
  border-radius: 4px;
  transition: width .2s ease;
}
.progress span{
  display: block;
  margin-top: 7px;
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* 导出中：去掉纸张阴影，避免被画进 PDF */
.pages.exporting .page{
  box-shadow: none;
  border-radius: 0;
}

/* ============ 其他 ============ */
.measure{
  position: absolute;
  top: 0; left: -20000px;
  width: 642px;   /* 由 JS 覆盖为内容区宽度 */
  display: flow-root;
}

.toast{
  position: fixed;
  left: 50%; bottom: 28px;
  transform: translateX(-50%);
  max-width: 560px;
  padding: 10px 16px;
  border-radius: 9px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 0 8px 28px rgba(16,24,40,.24);
  z-index: 100;
}

/* ============ 打印 ============ */
@page{ size: A4 portrait; margin: 0; }

@media print{
  html, body{
    height: auto;
    background: #fff;
    overflow: visible;
  }
  .topbar, .splitter, .pane-head, .pane-editor,
  .drawer, .scrim, .toast, .drop-mask, .measure,
  .menu, .modal{ display: none !important; }

  .workspace{
    display: block;
    height: auto;
    min-height: 0;
  }
  .pane-preview{
    display: block;
    overflow: visible;
    background: #fff;
  }
  .preview-scroll{
    overflow: visible;
    padding: 0;
    background: #fff;
  }
  .pages-zoom{
    transform: none !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
  }
  .pages{ display: block; }
  .page{
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    break-after: page;
    page-break-after: always;
    page-break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .page:last-child{ break-after: auto; page-break-after: auto; }
  .page-head, .page-foot{ display: flex; }
}
