/* ===== 编辑器样式（独立引用，补齐设计变量） ===== */
:root {
  --brand: #10b981;
  --brand-2: #2563eb;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e9eef3;
  --bg: #f6f9fb;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(15, 23, 42, .08);
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, .06);
}
* { box-sizing: border-box; }
/* hidden 属性必须真的隐藏：作者样式里的 display:flex 会盖掉浏览器默认的 display:none。
   之前每个弹窗都要单独写一条 .xxx[hidden]，漏一个就露馅，这里统一兜住。 */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.6;
  display: flex; flex-direction: column; height: 100vh; overflow: hidden;
}

/* 按钮（编辑页独立引用，base.css 不在本页加载） */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  font-family: inherit; line-height: 1.4;
  cursor: pointer; border: 1px solid transparent; transition: .15s;
}
.btn--primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.btn--primary:hover { filter: brightness(1.05); box-shadow: var(--shadow-sm); }
.btn--ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }
.ed-toolbar .btn { padding: 7px 15px; font-size: 13px; }

.ed-toolbar {
  position: sticky; top: 0; z-index: 40; flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  min-height: 56px; padding: 8px 18px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.ed-toolbar .title { font-weight: 700; font-size: 15px; white-space: nowrap; }
.ed-toolbar .spacer { flex: 1 1 auto; min-width: 8px; }
.ed-toolbar select {
  padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line);
  font-size: 13px; background: #fff; color: var(--ink); cursor: pointer;
  font-family: inherit;
}

/* 简历切换 */
.ed-doc { display: flex; align-items: center; gap: 6px; }
.ed-doc select { max-width: 190px; }
.icon-btn {
  width: 32px; height: 32px; flex: 0 0 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }

/* 模板选择 */
.ed-tpl { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.ed-tpl select { max-width: 200px; }

/* 更多菜单 */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 70;
  min-width: 200px; padding: 6px;
  /* 窗口矮的时候菜单会顶出屏幕，给个上限自己滚 */
  max-height: calc(100vh - 110px); overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 36px rgba(15,23,42,.16);
}
.menu[hidden] { display: none; }
.menu button {
  display: block; width: 100%; padding: 8px 10px;
  border: none; background: transparent; border-radius: 7px;
  text-align: left; font-size: 13px; color: var(--ink);
  font-family: inherit; cursor: pointer;
}
.menu button:hover { background: #f1f5f9; }
.menu button.danger { color: #dc2626; }
.menu button.danger:hover { background: #fef2f2; }
.menu hr { border: none; border-top: 1px solid var(--line); margin: 5px 4px; }

.ed-body {
  flex: 1 1 auto; min-height: 0;
  display: grid; grid-template-columns: 420px 1fr;
}
@media (max-width: 900px) {
  .ed-toolbar { gap: 8px; padding: 8px 12px; }
  .ed-toolbar .title { display: none; }
  .ed-doc select { max-width: 140px; }
  .ed-tpl select { max-width: 150px; }
}
@media (max-width: 820px) {
  body { height: auto; overflow: auto; }
  .ed-body { display: flex; flex-direction: column; }
  .ed-preview { order: -1; height: 62vh; }
  .ed-form { border-right: none; border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .ed-toolbar .spacer { display: none; }
  /* 窄屏工具条：第一行简历，第二行模板，第三行常用键 + 更多 + 导出 */
  .tb-btn { order: 3; padding: 6px 8px; font-size: 12px; }
  .ed-doc { flex: 1 1 100%; order: 1; }
  .ed-doc select { max-width: none; width: 100%; }
  .ed-tpl { order: 2; flex: 1 1 auto; }
  .ed-tpl select { max-width: none; flex: 1 1 auto; }
  .menu-wrap { order: 3; }
  .export-wrap { order: 4; margin-left: auto; }
  .ed-preview { padding: 12px; }
}

/* 左侧表单 */
.ed-form { overflow-y: auto; padding: 18px 18px 60px; background: #fbfdff; border-right: 1px solid var(--line); }
.fgroup { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 16px; margin-bottom: 14px; }
.fgroup > h3 { margin: 0 0 12px; font-size: 14px; color: var(--brand); display: flex; align-items: center; justify-content: space-between; }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field input, .field textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; font-family: inherit; color: var(--ink); background: #fff; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
.field textarea { min-height: 56px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.item-card { border: 1px dashed var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; background: #fafcff; }
.item-card .field:last-child { margin-bottom: 0; }
.mini-btn {
  font-size: 12px; padding: 4px 10px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; color: var(--muted); cursor: pointer;
}
.mini-btn:hover { border-color: var(--brand); color: var(--brand); }
.mini-btn.danger:hover { border-color: #ef4444; color: #ef4444; }
.add-btn {
  width: 100%; padding: 8px; border-radius: 8px; border: 1px dashed var(--brand);
  background: #ecfdf5; color: var(--brand); font-size: 13px; cursor: pointer; font-weight: 600;
}
.add-btn:hover { background: var(--brand); color: #fff; }
.hint { font-size: 11.5px; color: var(--muted); margin: 2px 0 0; }

/* 右侧预览 */
.ed-preview { overflow-y: auto; padding: 24px; background: #eef2f6; display: flex; flex-direction: column; align-items: center; }
.ed-preview__bar { width: 100%; max-width: 820px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; color: var(--muted); font-size: 12.5px; }
.page-info {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px;
  background: #ecfdf5; color: #047857; font-size: 11.5px; border: 1px solid #c7f0e0;
}
.page-info:empty { display: none; }
.page-info--warn { background: #fffbeb; color: #b45309; border-color: #fde68a; }

/* 压缩到一页 */
.ed-preview__left { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.fit-one {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 2px 10px; font-family: inherit; font-size: 11.5px; line-height: 1.6;
  color: var(--muted); cursor: pointer; white-space: nowrap; transition: .14s;
}
.fit-one[hidden] { display: none; }
.fit-one:hover { border-color: var(--brand); color: var(--brand); }
.fit-one--on { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.fit-one--on:hover { border-color: #059669; color: #047857; }
.fit-one--warn { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.fit-one--warn:hover { border-color: #f59e0b; color: #b45309; }
.ed-canvas { width: 800px; max-width: 100%; display: flex; justify-content: center; }
.ed-canvas .resume { box-shadow: 0 10px 40px rgba(15,23,42,.18); border-radius: 2px; overflow: hidden; }
.ed-canvas .resume-show-new {
  box-shadow: 0 10px 40px rgba(15,23,42,.18); border-radius: 2px; overflow: hidden;
  background: #fff; min-height: 900px;
}
.ed-canvas .resume-show-new, .ed-canvas .resume-show-new * { box-sizing: border-box; }

/* 模板样式按需加载时的占位骨架 */
.rm-skeleton {
  width: 100%; min-height: 900px; background: #fff; border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px; letter-spacing: .3px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, .18);
}
@keyframes rmFade { from { opacity: 0 } to { opacity: 1 } }
.ed-canvas > .resume-show-new, .ed-canvas > .resume { animation: rmFade .22s ease both; }

/* ===== ATS 检查面板 ===== */
.ats-mask {
  position: fixed; inset: 0; z-index: 100; padding: 20px;
  background: rgba(15,23,42,.45);
  display: flex; align-items: center; justify-content: center;
}
.ats-mask[hidden] { display: none; }
.ats-panel {
  width: 100%; max-width: 520px; max-height: 86vh; overflow-y: auto;
  background: #fff; border-radius: 16px; padding: 20px 22px 18px;
  box-shadow: 0 20px 60px rgba(15,23,42,.28);
}
.ats-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ats-head h2 { margin: 0; font-size: 16px; color: var(--ink); }
.ats-x {
  border: none; background: transparent; font-size: 24px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 0 2px;
}
.ats-x:hover { color: var(--ink); }
.ats-score {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px; border-radius: 12px; background: #f6f9fc; margin-bottom: 14px;
}
.ats-score__num { font-size: 34px; font-weight: 700; line-height: 1; }
.ats-score__lvl { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.ats-score__hint { font-size: 12px; color: var(--muted); }
.ats-list { list-style: none; margin: 0 0 16px; padding: 0; }
.ats-list li {
  display: flex; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.ats-list li:last-child { border-bottom: none; }
.ats-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; }
.ats-dot--pass { background: #10b981; }
.ats-dot--warn { background: #f59e0b; }
.ats-dot--fail { background: #ef4444; }
.ats-li__title { font-weight: 600; color: var(--ink); }
.ats-li__detail { color: var(--muted); font-size: 12.5px; margin-top: 2px; line-height: 1.55; }
.ats-li { flex: 1 1 auto; min-width: 0; }

/* 可定位的待改条目 */
.ats-fixes { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ats-fix {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 10px; border-radius: 8px; border: 1px solid #fde68a;
  background: #fffbeb; cursor: pointer; text-align: left;
  font-family: inherit; font-size: 12px; color: var(--ink); transition: .14s;
}
.ats-fix:hover { border-color: #f59e0b; background: #fef3c7; }
.ats-fix__label {
  flex: 1 1 auto; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.ats-fix__issue { flex: 0 0 auto; color: #b45309; font-size: 11.5px; }
.ats-fix__go { flex: 0 0 auto; color: var(--brand); font-weight: 600; font-size: 11.5px; }
.ats-fixes__more { font-size: 11.5px; color: var(--muted); padding-left: 2px; }

/* 跳转后高亮闪烁 */
@keyframes rmFlash {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .5); }
  60% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.rm-flash {
  border-color: var(--brand) !important;
  background: #f0fdf4 !important;
  animation: rmFlash 1.2s ease 2;
}
.ats-actions { display: flex; gap: 10px; }
.ats-actions .btn { flex: 1; justify-content: center; }
.ats-tip { margin: 10px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.55; }
/* 面板里指向百科的说明链接：这两块规则以前没地方解释，只能靠猜 */
.ats-help { color: var(--brand); font-weight: 600; white-space: nowrap; }
.ats-help:hover { text-decoration: underline; }

/* ===== JD 关键词匹配面板 ===== */
.jd-panel { max-width: 640px; }
.jd-tip { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.jd-tip strong { color: #059669; font-weight: 600; }
.jd-input {
  width: 100%; min-height: 132px; resize: vertical;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 13px; line-height: 1.7; color: var(--ink);
  background: #fcfdfe; outline: none; transition: .14s;
}
.jd-input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.jd-actions { display: flex; gap: 10px; margin: 12px 0 4px; }
.jd-actions .btn { justify-content: center; }
.jd-actions #jdRun { min-width: 132px; }

.jd-result:not(:empty) { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.jd-empty { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.jd-score {
  display: flex; align-items: center; gap: 16px;
  padding: 13px 16px; border-radius: 12px; background: #f6f9fc; margin-bottom: 14px;
}
.jd-score__num { font-size: 34px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.jd-score__num small { font-size: 15px; font-weight: 600; margin-left: 1px; }
.jd-score__lvl { font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
.jd-score__hint { font-size: 12px; color: var(--muted); }
.jd-sec { margin-bottom: 14px; }
.jd-sec:last-child { margin-bottom: 0; }
.jd-sec__head {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 8px;
}
.jd-sec__head span { font-size: 11.5px; font-weight: 400; color: var(--muted); }
.jd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.jd-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 999px; font-size: 12px; line-height: 1.5;
  font-family: inherit; border: 1px solid transparent;
}
.jd-chip--hit { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.jd-chip--gap {
  background: #fffbeb; border-color: #fde68a; color: #b45309;
  cursor: pointer; transition: .14s;
}
.jd-chip--gap:hover { background: #fef3c7; border-color: #f59e0b; }
.jd-chip--gap:hover i { transform: scale(1.15); }
.jd-chip--gap i {
  font-style: normal; font-weight: 700; font-size: 13px; line-height: 1;
  color: var(--brand); transition: .14s;
}
.jd-more { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.jd-next { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.jd-next__btn { width: 100%; justify-content: center; }
.jd-groups { display: flex; flex-direction: column; gap: 7px; }
.jd-group { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.jd-group__name { flex: 0 0 84px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jd-group__bar { flex: 1 1 auto; height: 6px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.jd-group__bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #60a5fa, #2563eb); transition: width .3s ease; }
.jd-group__num { flex: 0 0 auto; color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 11.5px; }

/* ===== 按 JD 生成简历版本 ===== */
.tailor-ids { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.tl-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tl-field > span { font-size: 11.5px; color: var(--muted); }
.tl-field input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 12.5px; color: var(--ink); background: #fcfdfe;
  outline: none; transition: .14s;
}
.tl-field input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }

.tl-sec { margin-bottom: 14px; }
.tl-sec:last-child { margin-bottom: 0; }
.tl-head {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 8px;
}
.tl-head span { font-size: 11.5px; font-weight: 400; color: var(--muted); }

.tl-chks { display: flex; flex-direction: column; gap: 2px; }
.tl-chk {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; font-size: 12.5px; line-height: 1.6; color: var(--ink);
  cursor: pointer; transition: .14s;
}
.tl-chk + .tl-chk { margin-top: 6px; }
.tl-chk:hover { border-color: #cbd5e1; background: #fbfdff; }
.tl-chk input {
  flex: 0 0 auto; width: 14px; height: 14px; margin: 3px 0 0;
  accent-color: var(--brand); cursor: pointer;
}
.tl-chk:has(input:not(:checked)) { background: #fafbfc; color: #94a3b8; }
.tl-chk:has(input:not(:checked)) span { text-decoration: line-through; }

.tl-adds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.tl-adds li {
  display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap;
  padding: 7px 10px; border-radius: 8px; background: #f6f9fc;
  font-size: 12.5px; line-height: 1.55;
}
.tl-adds b { color: #047857; font-weight: 600; }
.tl-from { font-size: 11.5px; color: var(--muted); }
.tl-more { font-size: 11.5px; color: var(--muted); margin: 7px 0 0; }

.tl-none {
  margin: 0 0 14px; padding: 11px 13px; border-radius: 10px;
  background: #ecfdf5; border: 1px solid #a7f3d0;
  font-size: 12.5px; line-height: 1.65; color: #047857;
}
.tl-name {
  margin: 0; padding: 10px 13px; border-radius: 9px;
  background: #f6f9fc; border: 1px dashed #cbd5e1;
  font-size: 13.5px; font-weight: 600; color: var(--ink); word-break: break-all;
}

.tailor-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.tailor-actions { display: flex; gap: 10px; }
.tailor-actions .btn { justify-content: center; }
.tailor-actions .btn:disabled { opacity: .5; cursor: not-allowed; }
.tailor-hint { margin: 9px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.6; }

@media (max-width: 560px) {
  .tailor-ids { grid-template-columns: 1fr; }
  .tailor-actions { flex-direction: column; }
}

/* ===== 面试准备题库 ===== */
.iv-panel {
  max-width: 680px; display: flex; flex-direction: column;
  overflow: hidden;   /* 内部自己滚，底部按钮不跟着走 */
}
.iv-stat {
  padding: 10px 13px; border-radius: 10px; background: #f6f9fc;
  font-size: 12.5px; line-height: 1.6; color: var(--muted); margin-bottom: 12px;
}
.iv-stat b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.iv-body { flex: 1 1 auto; overflow-y: auto; margin: 0 -6px; padding: 0 6px; min-height: 120px; }

.iv-group { border: 1px solid var(--line); border-radius: 11px; margin-bottom: 9px; background: #fff; }
.iv-group > summary {
  display: flex; align-items: center; gap: 9px; padding: 11px 13px;
  font-size: 13px; font-weight: 600; color: var(--ink);
  cursor: pointer; list-style: none; user-select: none;
}
.iv-group > summary::-webkit-details-marker { display: none; }
.iv-group > summary::before { content: "▸"; color: var(--muted); font-size: 11px; transition: .15s; }
.iv-group[open] > summary::before { content: "▾"; }
.iv-group > summary:hover { background: #fafcff; }
.iv-group__t { flex: 1 1 auto; }
.iv-group__n {
  flex: 0 0 auto; font-size: 11.5px; font-weight: 600; color: var(--muted);
  background: #f1f5f9; border-radius: 999px; padding: 2px 8px;
  font-variant-numeric: tabular-nums;
}
.iv-list { padding: 0 12px 10px; }

.iv-q {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 9px 10px; border-radius: 9px; transition: .14s; cursor: pointer;
}
.iv-q + .iv-q { margin-top: 2px; }
.iv-q:hover { background: #fafcff; }
.iv-q input {
  flex: 0 0 auto; width: 14px; height: 14px; margin: 3px 0 0;
  accent-color: #10b981; cursor: pointer;
}
.iv-q__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.iv-q__text { font-size: 13px; line-height: 1.6; color: var(--ink); }
.iv-q__point { font-size: 11.5px; line-height: 1.6; color: var(--muted); }
/* 已准备：只降调，不加删除线 —— 复盘时还要能顺畅重读 */
.iv-q--done .iv-q__text { color: #94a3b8; }
.iv-q--done .iv-q__point { opacity: .6; }
.iv-q--done { background: #fafcfb; }

.iv-foot {
  flex: 0 0 auto; display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
}
.iv-foot .btn { font-size: 12.5px; }
.iv-hint { font-size: 11.5px; color: var(--muted); }

@media (max-width: 560px) {
  .iv-panel { max-height: 90vh; }
  .iv-foot { flex-direction: column; align-items: stretch; }
  .iv-foot .btn { justify-content: center; }
  .iv-hint { text-align: center; }
}

/* ===== 页面结构（区块排序 / 自定义模块） ===== */
.lay-panel { max-width: 560px; }
.lay-list { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.lay-item {
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  transition: border-color .14s, box-shadow .14s, opacity .14s;
  position: relative;
}
.lay-item:hover { border-color: #cbd5e1; box-shadow: 0 2px 8px rgba(15,23,42,.05); }
.lay-item.lay-dragging { opacity: .45; }
.lay-item.lay-over-top { box-shadow: 0 -2px 0 0 var(--brand); }
.lay-item.lay-over-bottom { box-shadow: 0 2px 0 0 var(--brand); }
.lay-row { display: flex; align-items: center; gap: 8px; padding: 9px 10px; cursor: grab; }
.lay-row:active { cursor: grabbing; }
.lay-grip {
  flex: 0 0 auto; color: #cbd5e1; font-size: 13px; line-height: 1;
  letter-spacing: -2px; user-select: none;
}
.lay-name {
  flex: 1 1 auto; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lay-count, .lay-tag {
  flex: 0 0 auto; font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: #f1f5f9; color: var(--muted);
}
.lay-tag { background: #eff6ff; color: #2563eb; }
.lay-ops { flex: 0 0 auto; display: flex; gap: 4px; }
.lay-btn {
  width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
  color: var(--muted); font-size: 12px; line-height: 1; cursor: pointer;
  font-family: inherit; transition: .14s; padding: 0;
}
.lay-btn:hover { border-color: var(--brand); color: var(--brand); }
.lay-btn--del:hover { border-color: #dc2626; color: #dc2626; background: #fef2f2; }
.lay-edit { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.lay-edit input, .lay-edit textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 12.5px; line-height: 1.6; color: var(--ink);
  background: #fcfdfe; outline: none; resize: vertical; transition: .14s;
}
.lay-edit input:focus, .lay-edit textarea:focus { border-color: var(--brand); background: #fff; }
.lay-note {
  margin: 0 0 12px; padding: 9px 12px; border-radius: 9px;
  background: #fffbeb; border: 1px solid #fde68a; color: #b45309;
  font-size: 12px; line-height: 1.6;
}
.lay-note[hidden] { display: none; }
.lay-actions { display: flex; gap: 10px; }
.lay-actions #layAdd { flex: 1 1 auto; }

/* ===== AI 润色面板 ===== */
.ai-panel { max-width: 660px; }
.ai-sec { margin-bottom: 12px; }
.ai-label {
  display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 6px;
}
.ai-len { font-weight: 400; color: var(--muted); margin-left: 4px; }
.ai-select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px;
  font-family: inherit; font-size: 13px; color: var(--ink); background: #fff; cursor: pointer;
}
.ai-select:focus { outline: none; border-color: var(--brand); }
#aiInput { min-height: 108px; }

.ai-actions { display: flex; gap: 10px; margin: 4px 0 8px; flex-wrap: wrap; }
.ai-actions .btn { flex: 0 0 auto; }
.ai-note {
  margin: 0 0 12px; font-size: 12px; line-height: 1.6; color: var(--muted);
}
.ai-note code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px;
  background: #f1f5f9; padding: 1px 5px; border-radius: 4px; color: #0f172a;
}
.ai-note--net { color: #b45309; }
.ai-note--net code { background: #fef3c7; color: #7c2d12; }
.ai-note--ok { color: #047857; }

.ai-result:not(:empty) { margin-top: 4px; }
.ai-empty, .ai-loading, .ai-err {
  margin: 0 0 10px; font-size: 12.5px; line-height: 1.65; padding: 10px 12px; border-radius: 9px;
}
.ai-empty { color: var(--muted); background: #f8fafc; }
.ai-loading { color: #2563eb; background: #eff6ff; }
.ai-err { color: #b91c1c; background: #fef2f2; }

.ai-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.ai-cmp__col {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; min-width: 0;
  display: flex; flex-direction: column;
}
.ai-cmp__col--new { border-color: #a7f3d0; }
.ai-cmp__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 7px 11px; font-size: 11.5px; font-weight: 600; color: var(--muted);
  background: #f8fafc; border-bottom: 1px solid var(--line);
}
.ai-cmp__col--new .ai-cmp__head { background: #ecfdf5; color: #047857; border-bottom-color: #a7f3d0; }
.ai-cmp__head span { font-weight: 400; font-size: 11px; }
.ai-cmp__body {
  padding: 10px 11px; font-size: 12.5px; line-height: 1.8; color: var(--ink);
  white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow-y: auto;
}
.ai-apply { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.ai-apply__tip { font-size: 11.5px; color: var(--muted); }

.ai-cfg {
  border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px;
}
.ai-cfg summary {
  font-size: 12.5px; color: var(--muted); cursor: pointer; user-select: none;
  list-style: none; padding: 2px 0;
}
.ai-cfg summary::-webkit-details-marker { display: none; }
.ai-cfg summary::before { content: "▸ "; }
.ai-cfg[open] summary::before { content: "▾ "; }
.ai-cfg summary:hover { color: var(--brand); }
.ai-cfg__body { padding-top: 10px; display: flex; flex-direction: column; gap: 9px; }
.ai-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ai-field > span { font-size: 11.5px; color: var(--muted); }
.ai-field input {
  width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 12.5px; color: var(--ink); background: #fcfdfe; outline: none;
}
.ai-field input:focus { border-color: var(--brand); background: #fff; }
.ai-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.ai-cfg__foot { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.ai-cfg__foot .btn { padding: 6px 14px; font-size: 12.5px; }
.ai-cfg__hint { font-size: 11.5px; color: var(--brand); line-height: 1.55; flex: 1 1 100%; min-width: 0; }
.ai-cfg__hint--ok { color: #047857; }
.ai-cfg__hint--err { color: #b91c1c; }

@media (max-width: 560px) {
  .ai-cmp { grid-template-columns: 1fr; }
  .ai-row2 { grid-template-columns: 1fr; }
  .ai-actions .btn { flex: 1 1 auto; }
}

/* 导出 PDF：打印时只保留简历纸面 */
@media print {
  body { height: auto; overflow: visible; display: block; }
  .ed-toolbar, .ed-form, .ed-preview__bar, .nav { display: none !important; }
  .ats-mask { display: none !important; }
  .ed-body { display: block; height: auto; }
  .ed-preview { padding: 0; background: #fff; overflow: visible; }
  .ed-canvas { width: auto; max-width: 100%; }
  .ed-canvas .resume { box-shadow: none; border-radius: 0; width: 100%; min-height: auto; }
  .ed-canvas .resume-show-new { box-shadow: none; border-radius: 0; min-height: auto; }
  @page { size: A4; margin: 0; }
}

/* ===== 简历语言选择（基本信息面板顶部） ===== */
.lang-pick { margin-bottom: 12px; }
.lang-pick > label {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.lang-pick__hint {
  font-weight: 400; font-size: 11.5px; color: var(--muted, #7a8798);
  letter-spacing: 0; text-transform: none;
}
.lang-pick__opts {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 7px;
}
.lang-chip {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 7px 4px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; cursor: pointer; transition: border-color .14s, background .14s, color .14s;
  font-family: inherit; line-height: 1.2;
}
.lang-chip b {
  font-size: 12px; font-weight: 800; color: var(--ink); letter-spacing: .2px;
}
.lang-chip span {
  font-size: 10.5px; color: var(--muted, #7a8798); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.lang-chip:hover { border-color: var(--brand); }
.lang-chip.is-on {
  border-color: var(--brand); background: #ecfdf5;
  box-shadow: inset 0 0 0 1px var(--brand);
}
.lang-chip.is-on b { color: var(--brand); }
.lang-chip.is-on span { color: #047857; }
.lang-chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

@media (max-width: 420px) {
  .lang-pick__opts { grid-template-columns: repeat(2, 1fr); }
  .lang-chip span { font-size: 10px; }
}

/* AI 面板：模型名旁的「免费档」标记 */
.ai-free {
  font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
  padding: 1px 5px; border-radius: 4px; margin-left: 4px;
  color: #047857; background: #ecfdf5; border: 1px solid #a7f3d0;
  vertical-align: 1px;
}

/* ===== 排版微调（Aa 浮层） ===== */
.ed-preview__bar { position: relative; }
.type-btn {
  height: 26px; padding: 0 10px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: #374151;
  font-size: 12px; line-height: 1; white-space: nowrap;
}
.type-btn:hover, .type-btn[aria-expanded="true"] { border-color: var(--brand); color: var(--brand); }
.type-pop {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; width: 318px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 34px rgba(17, 24, 39, .14); padding: 14px 14px 10px;
}
.type-pop[hidden] { display: none; }
.type-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 11px; }
.type-row > label { width: 46px; flex: 0 0 auto; font-size: 12.5px; color: var(--muted); line-height: 26px; }
.type-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.type-opt {
  height: 26px; padding: 0 10px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: #374151;
  font-size: 12px; line-height: 1;
}
.type-opt:hover { border-color: #c9cfd8; }
.type-opt.is-on { border-color: var(--brand); color: var(--brand); background: #eff4ff; }
.type-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 2px; padding-top: 10px; border-top: 1px solid var(--line);
}
.type-foot > span { font-size: 11.5px; color: var(--muted); }
.type-reset { background: none; border: none; cursor: pointer; font-size: 12px; color: var(--muted); text-decoration: underline; padding: 0; }
.type-reset:hover { color: var(--brand); }
@media (max-width: 560px) {
  .type-pop { width: min(318px, calc(100vw - 32px)); left: 0; }
}

/* ================= 版本历史 ================= */
.hist-panel { max-width: 560px; }
.hist-count {
  font-size: 11.5px; font-weight: 400; color: var(--muted);
  margin-left: 6px; font-variant-numeric: tabular-nums;
}
.hist-body { max-height: 46vh; overflow-y: auto; margin: 4px -4px 0; padding: 0 4px; }
.hist-empty { font-size: 13px; color: var(--muted); padding: 22px 4px; text-align: center; line-height: 1.7; }
.hist-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 12px;
  padding: 9px 12px; margin-bottom: 8px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff;
}
.hist-row:hover { border-color: #c9cfd8; }
.hist-row.is-same { background: #f8fafc; }
.hist-main {
  grid-column: 1; grid-row: 1;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0;
}
.hist-time { font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.hist-note {
  font-size: 11.5px; color: var(--brand); background: #eff4ff;
  border-radius: 999px; padding: 1px 8px; max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hist-same { font-size: 11.5px; color: var(--muted); }
.hist-meta {
  grid-column: 1; grid-row: 2;
  font-size: 11.5px; color: var(--muted); line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hist-acts { grid-column: 2; grid-row: 1 / span 2; align-self: center; display: flex; gap: 6px; }
.hist-btn {
  height: 26px; padding: 0 10px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: #374151;
  font-size: 12px; line-height: 1;
}
.hist-btn:hover { border-color: var(--brand); color: var(--brand); }
.hist-btn--del:hover { border-color: #e0625f; color: #e0625f; }
.hist-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
}
.hist-hint { font-size: 11.5px; color: var(--muted); margin-left: auto; }

@media (max-width: 560px) {
  .hist-row { grid-template-columns: minmax(0, 1fr) auto; }
  .hist-meta { white-space: normal; }
  .hist-hint { margin-left: 0; flex-basis: 100%; }
}

/* ================= 求职信 ================= */
.cover-panel { max-width: 580px; }
.cover-ids { display: flex; gap: 10px; margin-bottom: 12px; }
.cover-ids .tl-field { flex: 1 1 0; margin: 0; }
.cover-text { min-height: 150px; line-height: 1.85; }
.cover-out { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.cover-trace { margin-top: 12px; }
.cover-trace__h {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px;
  font-size: 12px; color: var(--ink);
}
.cover-trace__h span { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.cover-trace ul { list-style: none; margin: 0; padding: 0; }
.cover-trace li {
  display: flex; gap: 8px; align-items: baseline;
  font-size: 12px; padding: 5px 0; border-bottom: 1px dashed var(--line);
}
.cover-trace li:last-child { border-bottom: none; }
.cf-from {
  flex: 0 0 auto; font-size: 11px; color: var(--brand); background: #eff4ff;
  border-radius: 5px; padding: 1px 6px; white-space: nowrap;
}
.cover-trace em { font-style: normal; color: #374151; min-width: 0; }
.cf-none { font-size: 12px; color: var(--muted); }
.cover-gap {
  margin: 10px 0 0; padding: 9px 11px; border-radius: 9px;
  background: #fff8e8; border: 1px solid #f4e2b8;
  font-size: 12px; line-height: 1.7; color: #7a5a13;
}
.cover-gap b { color: #a67c00; }
.cover-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
}
.cover-hint { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.ai-note--ok { color: #1d7a46; }
.ai-note--err { color: #b4453f; }

@media (max-width: 560px) {
  .cover-ids { flex-direction: column; }
}

/* ================= 导入旧简历 ================= */
.imp-panel { max-width: 560px; }
.imp-pick { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; }
.imp-name { font-size: 12.5px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-result { margin-top: 6px; }
.imp-sec { margin-bottom: 14px; }
.imp-sec__h {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 7px;
}
.imp-sec__h span { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.imp-basic {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.imp-kv {
  display: flex; gap: 8px; align-items: baseline;
  background: #fff; padding: 7px 10px; font-size: 12.5px;
}
.imp-kv span { flex: 0 0 34px; color: var(--muted); }
.imp-kv b { font-weight: 600; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-miss { color: #b0b8c4 !important; font-weight: 400 !important; }
.imp-list { display: flex; flex-direction: column; gap: 6px; }
.imp-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 13px; cursor: pointer; background: #fff;
}
.imp-row:hover { border-color: #c9cfd8; }
.imp-row.is-empty { background: #fafbfc; color: var(--muted); cursor: default; }
.imp-row input { accent-color: var(--brand); }
.imp-row__t { flex: 1 1 auto; }
.imp-row__n { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.imp-raw { margin-top: 4px; }
.imp-raw summary {
  font-size: 12px; color: var(--muted); cursor: pointer; padding: 6px 0;
}
.imp-raw pre {
  margin: 6px 0 0; padding: 10px 12px; max-height: 180px; overflow: auto;
  background: #f7f9fb; border: 1px solid var(--line); border-radius: 9px;
  font-size: 11.5px; line-height: 1.7; color: #475467; white-space: pre-wrap;
  font-family: Consolas, "SF Mono", Menlo, monospace;
}
.imp-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
}
.imp-hint { font-size: 11.5px; color: var(--muted); margin-left: auto; }

@media (max-width: 560px) {
  .imp-basic { grid-template-columns: 1fr; }
  .imp-hint { margin-left: 0; flex-basis: 100%; }
}

/* ===== 老数据迁移提示条 ===== */
.mig-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 18px;
  background: #f0fdf4; border-bottom: 1px solid #c7f0e0;
  font-size: 13.5px; color: var(--ink);
}
.mig-bar__text { flex: 1; min-width: 240px; }
.mig-bar .btn { padding: 6px 14px; font-size: 13px; }

/* 顶部工具栏里的账号菜单，比首页窄一点 */
.ed-toolbar .acct__btn { padding: 6px 11px; font-size: 13px; max-width: 130px; }

/* ===== 我的模板面板 ===== */
.ut-panel { width: 620px; max-width: 94vw; }
.ut-make { display: flex; align-items: flex-end; gap: 10px; margin: 12px 0 6px; }
.ut-make .tl-field { flex: 1; }
.ut-make .btn { padding: 8px 16px; font-size: 13px; white-space: nowrap; }
.ut-msg { min-height: 18px; font-size: 12.5px; color: var(--brand); }
.ut-body { max-height: 46vh; overflow: auto; margin: 4px 0 8px; }
.ut-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 8px; background: #fff;
}
.ut-info { flex: 1; min-width: 0; }
.ut-row__name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.ut-row__meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ut-acts { display: flex; gap: 6px; flex: 0 0 auto; }
.ut-acts .btn { padding: 5px 11px; font-size: 12.5px; }
.ut-empty {
  padding: 22px 14px; text-align: center; font-size: 13px; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 10px;
}
.ut-foot { padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* 主题色色板 */
.theme-opts { align-items: center; }
.swatch {
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer; padding: 0;
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); font-size: 11px;
  color: #6b7280; background: #f3f4f6; line-height: 1;
}
.swatch.is-on { box-shadow: 0 0 0 2px var(--brand); }
.swatch--auto { width: auto; padding: 0 8px; border-radius: 999px; }
.swatch-custom {
  width: 26px; height: 24px; padding: 0; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; cursor: pointer;
}

/* ===== 工具栏：常用动作上横条 + 分组菜单 ===== */
.tb-btn { padding: 7px 12px; font-size: 13px; font-weight: 500; }

/* 21 项平铺太长，按用途分段，给小标题 */
.menu__label {
  padding: 9px 10px 3px;
  font-size: 11.5px; color: #94a3b8; letter-spacing: .3px;
}
.menu__label:first-child { padding-top: 3px; }

/* 「导出 PDF」+ 下拉箭头拼成一个按钮：主体点了直接打印，箭头出其他格式 */
.export-wrap { display: flex; align-items: center; }
.btn-split-main {
  border-radius: 999px 0 0 999px; padding-right: 13px;
}
.btn-split-caret {
  border-radius: 0 999px 999px 0; padding: 9px 9px; margin-left: 1px;
  font-size: 11px; line-height: 1;
}
@media (max-width: 900px) {
  .tb-btn { padding: 6px 9px; font-size: 12.5px; }
}
