/* ===========================================================
   简历生成（#/resume）
   左表单 / 右 A4 预览；打印时只输出纸。
   =========================================================== */

.cv-wrap { padding-bottom: var(--s10); max-width: 1240px; }

/* ---------------- 顶部 ---------------- */
.cv-missing {
  margin: var(--s3) 0 0;
  max-width: var(--readw);
  font-size: var(--fs-xs);
  line-height: 1.7;
  color: var(--fg-3);
}
.cv-missing b { color: var(--fg-2); font-weight: 600; }

.cv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s4);
}
.cv-print-tip {
  flex: 1 0 100%;
  margin: 2px 0 0;
  color: var(--fg-3);
  font-size: var(--fs-micro);
  line-height: 1.55;
}
.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--fg-3);
}
.btn.ghost:hover { color: var(--danger); border-color: var(--danger); }

/* ---------------- 两栏 ---------------- */
.cv-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  gap: var(--s6);
  align-items: start;
  margin-top: var(--s6);
}

/* ---------------- 表单 ---------------- */
.cv-form { display: grid; grid-template-columns:minmax(0,1fr); gap: var(--s4); min-width:0; }

.cv-card {
  min-width:0;
  padding: var(--s4) var(--s5) var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.cv-card-h { display: grid; gap: 3px; margin-bottom: var(--s4); }
.cv-card-h .cv-card-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; margin-bottom: 4px;
  border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--mono); font-size: 11px; font-weight: 700;
}
.cv-card-h h3 {
  margin: 0;
  font-size: var(--fs-h4); font-weight: 650; color: var(--fg);
  letter-spacing: -0.01em;
}
.cv-card-h p { margin: 0; font-size: var(--fs-micro); line-height: 1.6; color: var(--fg-3); }

.cv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s3);
}
.cv-field { display: grid; gap: 5px; min-width: 0; }
.cv-field.wide { grid-column: 1 / -1; }
.cv-l {
  display: flex; align-items: baseline; gap: 6px;
  font-size: var(--fs-micro); font-weight: 600; color: var(--fg-2);
}
.cv-l i {
  font-style: normal; font-weight: 400; font-size: 10px;
  color: var(--fg-3); padding: 0 4px;
  border: 1px solid var(--line); border-radius: 3px;
}
.cv-field input,
.cv-field textarea,
.cv-field select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--fg);
  font-family: inherit;
  font-size: var(--fs-sm);
  line-height: 1.6;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.cv-field input,
.cv-field select { height: 38px; }
.cv-field textarea { resize: vertical; min-height: 68px; }
.cv-field input::placeholder,
.cv-field textarea::placeholder { color: var(--fg-3); opacity: 0.75; }
.cv-field input:focus,
.cv-field textarea:focus,
.cv-field select:focus { border-color: var(--accent-line); box-shadow: var(--ring); background: var(--surface); }

/* 词表之外自己加技能 / 证书 */
.cv-custom-add { display: flex; gap: 6px; margin-top: 8px; }
.cv-custom-add input {
  flex: 1 1 auto; min-width: 0; height: 32px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg); color: var(--fg);
  font-family: inherit; font-size: var(--fs-xs); outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.cv-custom-add input:focus { border-color: var(--accent-line); box-shadow: var(--ring); background: var(--surface); }
.cv-custom-add .btn.small { flex: 0 0 auto; }

/* ---------------- 个人照片控件 ----------------
   没传：整块是一个可点的虚线框（file input 铺满并透明）。
   传了：左边缩略图 + 右边「换一张 / 移除」。 */
.cv-photo { display: flex; align-items: flex-start; gap: var(--s3); }

.cv-photo-empty {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  width: 100%; min-height: 96px; padding: var(--s3);
  border: 1px dashed var(--line-2); border-radius: var(--r);
  background: var(--bg);
  text-align: center; cursor: pointer;
  transition: border-color 0.16s, background 0.16s;
}
.cv-photo-empty:hover { border-color: var(--accent); background: var(--accent-soft); }
/* 真正接收点击的 input 铺满整块并隐形；不能 display:none，否则选不了文件 */
.cv-photo-empty input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  padding: 0; border: 0; background: none;
  opacity: 0; cursor: pointer;
}
.cv-photo-plus { font-size: 20px; line-height: 1; color: var(--accent); font-weight: 700; }
.cv-photo-t { font-size: var(--fs-xs); font-weight: 600; color: var(--fg-2); }
.cv-photo-empty > em { font-style: normal; font-size: 10px; line-height: 1.6; color: var(--fg-3); }

.cv-photo-img {
  flex: 0 0 auto;
  width: 76px; height: 100px;
  object-fit: cover;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg);
}
.cv-photo-ops { min-width: 0; display: grid; gap: 6px; align-content: start; }
.cv-photo-btns { display: flex; flex-wrap: wrap; gap: var(--s2); }
/* 换一张：label 伪装成按钮，input 隐形铺满（和导入备份同一套做法） */
.cv-photo-btns .cv-file,
.cv-photo-btns label.btn { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.cv-photo-btns label.btn input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  padding: 0; border: 0; background: none;
  opacity: 0; cursor: pointer;
}
.cv-photo-note { margin: 0; font-size: 10.5px; line-height: 1.65; color: var(--fg-3); }
.cv-photo-note b { color: var(--fg-2); font-weight: 600; }
.cv-photo-note em { font-style: normal; color: var(--fg-2); }

.cv-search {
  width: 100%; height: 38px;
  margin-bottom: var(--s3); padding: 0 var(--s3);
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg); color: var(--fg);
  font-family: inherit; font-size: var(--fs-sm); outline: none;
}
.cv-search:focus { border-color: var(--accent-line); box-shadow: var(--ring); }

/* 技能 / 证书 chips */
.cv-skillbox {
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}
.cv-grp { margin-bottom: var(--s3); }
.cv-grp:last-child { margin-bottom: 0; }
.cv-grp-h {
  margin-bottom: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--fg-3); text-transform: uppercase;
}
.cv-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.cv-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0 9px; height: 26px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--fg-2);
  font-family: inherit; font-size: var(--fs-xs);
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, color 0.14s;
}
.cv-chip:hover { border-color: var(--accent-line); color: var(--fg); }
.cv-chip i {
  font-style: normal; font-size: 9.5px; font-weight: 700;
  padding: 0 4px; border-radius: 2px;
  background: var(--accent); color: #fff;
}
.cv-chip.lv0 { color: var(--fg-2); }
.cv-chip.lv1 { border-color: var(--accent-line); color: var(--fg); background: var(--accent-soft); }
.cv-chip.lv2 { border-color: var(--accent-line); color: var(--fg); background: var(--accent-soft); }
.cv-chip.lv3 { border-color: var(--accent); background: var(--accent); color: #fff; }
.cv-chip.lv3 i { background: rgba(255, 255, 255, 0.22); color: #fff; }
.cv-chip.cert.on { border-color: var(--accent); background: var(--accent); color: #fff; }
.cv-chip.is-priority:not(.lv3) { box-shadow: inset 0 0 0 1px var(--accent-line); }
.cv-chip.is-priority::before {
  content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
}

/* 技能方向与教育选择器：帮助找到词，不替用户往简历里填词。 */
.cv-focus-head, .cv-picker-label {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2);
  margin: 0 0 8px; color: var(--fg-2); font-size: var(--fs-micro); font-weight: 600;
}
.cv-focus-head i, .cv-picker-label i {
  margin-left: 6px; padding: 1px 4px; border: 1px solid var(--line); border-radius: 3px;
  color: var(--fg-3); font-size: 9px; font-style: normal; font-weight: 500;
}
.cv-focus-head small, .cv-picker-label small { color: var(--fg-3); font-size: 10px; font-weight: 400; text-align: right; }
.cv-focus-list { display: flex; gap: 6px; overflow-x: auto; padding: 1px 0 10px; scrollbar-width: thin; }
.cv-focus {
  flex: 0 0 132px; min-height: 54px; padding: 8px 9px; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--bg); color: var(--fg-2); text-align: left;
  font-family: inherit; cursor: pointer; transition: border-color .16s, background .16s, transform .16s;
}
.cv-focus b, .cv-focus span { display: block; }
.cv-focus b { margin-bottom: 3px; color: var(--fg); font-size: var(--fs-xs); }
.cv-focus span { color: var(--fg-3); font-size: 10px; line-height: 1.35; }
.cv-focus:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.cv-focus.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.cv-edu-picker { margin-bottom: var(--s3); }
.cv-picker-label.degree { margin-top: var(--s3); }
.cv-school-search { margin: 0 0 8px; }
.cv-picked { display: flex; flex-wrap: wrap; gap: 5px; min-height: 0; }
.cv-picked:empty::before { content: '还没选学校'; color: var(--fg-3); font-size: 10.5px; line-height: 22px; }
.cv-picked span {
  display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 0 5px 0 8px;
  border: 1px solid var(--accent-line); border-radius: 999px; background: var(--accent-soft); color: var(--fg-2); font-size: 11px;
}
.cv-picked button { width: 16px; height: 16px; border: 0; border-radius: 50%; background: transparent; color: var(--fg-3); font: inherit; font-size: 16px; line-height: 14px; cursor: pointer; }
.cv-picked button:hover { background: var(--accent); color: #fff; }
.cv-school-suggest, .cv-degree-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.cv-suggest, .cv-degree {
  min-height: 25px; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--fg-3); font-family: inherit; font-size: 10.5px; cursor: pointer;
  transition: color .16s, border-color .16s, background .16s;
}
.cv-suggest:hover, .cv-degree:hover { border-color: var(--accent-line); color: var(--accent); }
.cv-suggest.custom { border-style: dashed; color: var(--accent); }
.cv-suggest-empty { color: var(--fg-3); font-size: 10.5px; line-height: 25px; }
.cv-degree.on { border-color: var(--accent); background: var(--accent); color: #fff; }
.cv-skill-draft {
  margin-top: var(--s3); padding: var(--s3); border: 1px solid var(--accent-line);
  border-radius: var(--r); background: var(--accent-soft);
}
.cv-skill-draft.empty { display: grid; gap: 4px; border-style: dashed; color: var(--fg-3); font-size: var(--fs-micro); }
.cv-skill-draft.empty b { color: var(--fg-2); font-size: var(--fs-xs); }
.cv-skill-draft-h { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); margin-bottom: 8px; }
.cv-skill-draft-h b { color: var(--fg); font-size: var(--fs-xs); }
.cv-skill-draft-h span { color: var(--fg-3); font-size: 10px; text-align: right; }
.cv-skill-draft-lines { display: grid; gap: 7px; }
.cv-skill-draft-lines p { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; margin: 0; color: var(--fg-2); font-size: 11px; line-height: 1.65; }
.cv-skill-draft-lines p > b { color: var(--accent); font-size: 10.5px; }

/* 增删行 */
.cv-list { display: grid; gap: var(--s3); }
.cv-row {
  padding: var(--s3);
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
  background: var(--bg);
}
.cv-row-h {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--s3);
}
.cv-row-n { font-size: var(--fs-micro); font-weight: 600; color: var(--fg-2); }
.cv-del {
  border: 0; background: none; padding: 0;
  color: var(--fg-3); font-family: inherit; font-size: var(--fs-micro);
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.cv-del:hover { color: var(--danger); }
.cv-add {
  width: 100%; height: 38px; margin-top: var(--s3);
  border: 1px dashed var(--line-2); border-radius: var(--r);
  background: transparent; color: var(--accent);
  font-family: inherit; font-size: var(--fs-xs); font-weight: 600;
  cursor: pointer; transition: border-color 0.16s, background 0.16s;
}
.cv-add:hover { border-color: var(--accent); background: var(--accent-soft); }
.cv-none {
  margin: 0; padding: var(--s3);
  border-radius: var(--r); background: var(--bg);
  font-size: var(--fs-xs); color: var(--fg-3);
}
.cv-save {
  margin: 0; font-size: var(--fs-micro); color: var(--fg-3); text-align: center;
}

/* ---------------- 预览（A4 纸） ----------------
   桌面端把纸面留在视窗内，滚轮只滚右侧预览；填写表单时不必反复跳回页面底部。 */
.cv-preview {
  min-width:0;
  position: sticky; top: 84px;
  display: flex; flex-direction: column;
  height: calc(100dvh - 104px);
  min-height: 360px;
}
.cv-pv-h {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  flex: 0 0 auto; margin-bottom: 4px;
  font-size: var(--fs-micro); color: var(--fg-3);
}
.cv-pv-t { font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.cv-pv-n { margin-left: auto; font-weight: 600; color: var(--fg-3); white-space: nowrap; }
.cv-pv-n.warn { color: #b45309; }
.cv-pv-z { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.cv-pv-z button {
  height: 22px; padding: 0 7px; border: 0; background: var(--bg); color: var(--fg-3);
  font-family: inherit; font-size: 10px; cursor: pointer;
}
.cv-pv-z button + button { border-left: 1px solid var(--line); }
.cv-pv-z button.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.cv-pv-sub {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex: 0 0 auto; margin-bottom: 8px;
  font-size: 10.5px; color: var(--fg-3);
}
.cv-fit-btn {
  flex: 0 0 auto; padding: 2px 8px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--accent);
  font-family: inherit; font-size: 10px; font-weight: 600; cursor: pointer;
}
.cv-fit-btn:hover { border-color: var(--accent); background: var(--accent-soft); }

/* 真 A4 画布：794×1122（96dpi），页面缩放只做 transform，不改排版 */
.cv-pages {
  flex: 1 1 auto; min-height: 0;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-alt);
}
.cv-pages-stage { position: relative; }
.cv-pages-frame {
  position: absolute; top: 0; left: 0;
  width: 794px;
  transform-origin: top left;
  will-change: transform;
}
.cv-paper {
  position: relative;
  width: 794px;
  min-height: 1122px;
  background: #fff;
  color: #14202b;
  box-shadow: 0 2px 18px rgba(0, 0, 0, 0.14);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.cv-paper .cv-sheet-in,
.cv-paper .cv-sheet-in * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.cv-paper .cv-sheet-in {
  min-height: 1122px;
  font-size: calc(14px * var(--cv-fit, 1));
  line-height: 1.72;
}
.cv-page-mark {
  position: absolute; left: 0; right: 0; height: 0;
  border-top: 1px dashed rgba(180, 83, 9, 0.75);
  z-index: 5; pointer-events: none;
}
.cv-page-mark::after {
  content: attr(data-label);
  position: absolute; right: 8px; top: -11px;
  padding: 0 6px;
  background: #fff; color: #b45309;
  font-family: var(--mono); font-size: 10px; line-height: 20px; font-weight: 600;
  border: 1px solid rgba(180, 83, 9, 0.35); border-radius: 3px;
}

.cv-sheet {
  min-height: 0;
  flex: 1 1 auto;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  box-shadow: var(--shadow);
  color: #14202b;
}
.cv-sheet::-webkit-scrollbar { width: 9px; }
.cv-sheet::-webkit-scrollbar-track { background: #f4f6f7; }
.cv-sheet::-webkit-scrollbar-thumb { border: 2px solid #f4f6f7; border-radius: 999px; background: #b6c0c6; }
.cv-sheet::-webkit-scrollbar-thumb:hover { background: #87959d; }
.cv-sheet { scrollbar-color: #b6c0c6 #f4f6f7; scrollbar-width: thin; }
.cv-sheet, .cv-sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.cv-sheet-in { font-size: 12.5px; line-height: 1.72; }
/* 纸面直改只提供一层安静的“可点”反馈，内容本身仍由模板排版。 */
.cv-sheet [data-rs-paper],
.cv-paper [data-rs-paper] {
  border-radius: 2px;
  cursor: text;
  outline: 1px dashed transparent;
  outline-offset: 2px;
  transition: background-color 140ms ease, outline-color 140ms ease;
}
.cv-sheet [data-rs-paper]:hover,
.cv-paper [data-rs-paper]:hover { outline-color: rgba(19, 123, 110, 0.38); }
.cv-sheet [data-rs-paper]:focus,
.cv-paper [data-rs-paper]:focus {
  outline-color: rgba(19, 123, 110, 0.78);
  background-color: rgba(19, 123, 110, 0.08);
}

.cv-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 16px;
  align-items: center;
  padding: 24px 34px 22px;
}
.cv-body { padding: 22px 34px 30px; }
.cv-head h2 {
  margin: 0;
  font-size: 25px; font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.1;
}
.cv-target { margin: 4px 0 0; font-size: 12px; color: #4a5b68; }
.cv-contact {
  margin: 0; padding: 0; list-style: none;
  display: grid; gap: 1px;
  text-align: right;
  font-size: 11px; color: #4a5b68;
  word-break: break-all;
}

.cv-sec { margin-top: 16px; }
.cv-sec h3 {
  margin: 0 0 7px;
  padding-bottom: 4px;
  border-bottom: 1px solid #d5dee4;
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  color: #14202b;
}

.cv-line {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
}
.cv-line b { font-weight: 650; }
.cv-line span { color: #3c4d5a; }
.cv-line em { margin-left: auto; font-style: normal; color: #63727d; font-size: 11px; }

.cv-skill { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 10px; margin-bottom: 9px; align-items: start; }
.cv-skill-k { color: #63727d; font-size: 11px; font-weight: 600; }
.cv-skill-v { color: #14202b; line-height: 1.7; }
.cv-skill-v i { font-style: normal; color: #63727d; font-size: 10.5px; }

.cv-item { margin-bottom: 11px; }
.cv-item:last-child { margin-bottom: 0; }
.cv-item-h {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px;
}
.cv-item-h b { font-weight: 650; }
.cv-stack { color: #63727d; font-size: 11px; }
.cv-role { color: #3c4d5a; }
.cv-time { margin-left: auto; font-style: normal; color: #63727d; font-size: 11px; }
.cv-bullets { margin: 4px 0 0; padding-left: 15px; }
.cv-bullets li { margin-bottom: 2px; }
.cv-sum { margin: 0; }
.cv-empty {
  margin: 26px 0 0; padding: 16px;
  border: 1px dashed #cbd6dd; border-radius: 3px;
  color: #63727d; font-size: 12px; text-align: center;
}

#resumePrintRoot { display:none; }
/* ---------------- 打印：只留纸 ---------------- */
@media print {
  /* 模板是按整页设计的（彩色侧栏/头图要出血），所以页边距交给模板自己的 padding。
     预览里的分页线按 1122px 走，和这里 297mm 的页高对齐。 */
  @page { size: A4; margin: 0; }

  html, body {
    margin: 0 !important; padding: 0 !important;
    height: auto !important; min-height: 0 !important;
    overflow: visible !important; background: #fff !important;
  }
  body.printing-resume > * { display:none !important; }
  body.printing-resume > #resumePrintRoot { display:block !important; position:static !important; width:210mm !important; margin:0 !important; }
  .topbar, .bg-layer, .foot, .cv-hero, .cv-tplbar, .cv-tips,
  .cv-form, .cv-pv-h, .cv-pv-sub, .cv-save { display: none !important; }

  .wrap, .cv-wrap { width: auto !important; max-width: none !important; padding: 0 !important; margin: 0 !important; }
  .cv-cols, .cv-preview, .cv-pages, .cv-pages-stage, .cv-pages-frame {
    display: block !important; position: static !important;
    width: auto !important; height: auto !important; min-height: 0 !important; max-height: none !important;
    margin: 0 !important; padding: 0 !important;
    overflow: visible !important; border: 0 !important; background: none !important;
    transform: none !important;
  }
  .cv-paper {
    width: auto !important; height: auto !important; min-height: 0 !important;
    background: #fff !important; box-shadow: none !important;
  }
  .cv-paper .cv-sheet-in {
    font-size: calc(10.5pt * var(--cv-fit, 1));
    line-height: 1.72;
    min-height: 1122px;
  }
  .cv-page-mark { display: none !important; }
  .cv-paper [data-rs-paper], .cv-sheet [data-rs-paper] { outline: 0 !important; background: transparent !important; }
  .cv-head { padding: 12pt 0 10pt; }
  .cv-body { padding: 14pt 0 0; }
  .cv-head h2 { font-size: 20pt; }
  .cv-sec { margin-top: 12pt; }
  .cv-item, .cv-sec, .cv-line, .bre-item { break-inside: avoid; }
  a { color: inherit !important; text-decoration: none !important; }
}

/* ---------------- 窄屏 ---------------- */
@media (max-width: 1080px) {
  .cv-cols { grid-template-columns: minmax(0,1fr); }
  .cv-preview { position: static; height: auto; min-height: 0; order: -1; }
  .cv-sheet { flex: initial; overflow: visible; }
  .cv-pages { max-height: 78vh; }
}
@media (max-width: 620px) {
  .cv-grid { grid-template-columns: 1fr; }
  .cv-card { padding: var(--s3); }
  .cv-pages { padding: 8px; max-height: 70vh; }
  .cv-pv-h { align-items: flex-start; }
  .cv-head { grid-template-columns: 1fr; padding: 18px 16px 16px; }
  .cv-body { padding: 16px 16px 22px; }
  .cv-contact { text-align: left; }
  .cv-skill { grid-template-columns: 1fr; gap: 0; }
  .cv-skill-draft-h { align-items: flex-start; flex-direction: column; gap: 3px; }
  .cv-skill-draft-h span { text-align: left; }
  .cv-skill-draft-lines p { grid-template-columns: 1fr; gap: 1px; }
  .cv-focus-head, .cv-picker-label { align-items: flex-start; flex-direction: column; gap: 3px; }
  .cv-focus-head small, .cv-picker-label small { text-align: left; }
  .cv-focus { flex-basis: 124px; }
  .cv-tplbar { padding: var(--s3); }
  .cv-tpl-rail-wrap { grid-template-columns: 26px minmax(0, 1fr) 26px; gap: 5px; }
  .cv-tpl-nav { width: 26px; height: 26px; font-size: 20px; line-height: 22px; }
  .cv-tpl { flex-basis: min(72vw, 220px); }
  .cv-tpl-current { margin-left: 31px; margin-right: 31px; }
}

/* ===========================================================
   模板选择 / 版本管理 / 岗位匹配
   =========================================================== */

/* ---------------- 模板选择条 ---------------- */
.cv-tplbar {
  margin-top: var(--s5);
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.cv-tplbar-h {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3);
  margin-bottom: var(--s3);
}
.cv-tplbar-h > div { display: grid; gap: 3px; }
.cv-tplbar-h b { font-size: var(--fs-sm); color: var(--fg); }
.cv-tplbar-h span { font-size: var(--fs-micro); color: var(--fg-3); }
.cv-tpl-count { flex: 0 0 auto; padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--fg-3); font-family: var(--mono); font-size: 10px !important; }
.cv-tpl-rail-wrap { display: grid; grid-template-columns: 30px minmax(0, 1fr) 30px; align-items: center; gap: 7px; }
.cv-tpl-rail {
  display: flex; gap: 9px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  scroll-behavior: smooth; padding: 2px 1px 9px; scrollbar-width: thin;
}
.cv-tpl-rail::-webkit-scrollbar { height: 5px; }
.cv-tpl-rail::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; }
.cv-tpl-nav {
  width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 50%;
  background: var(--bg); color: var(--fg-2); font-family: Georgia, serif; font-size: 22px; line-height: 26px; cursor: pointer;
  transition: border-color .16s, color .16s, background .16s;
}
.cv-tpl-nav:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.cv-tpl {
  position: relative; display: grid; grid-template-rows: 78px auto auto; gap: 7px; flex: 0 0 190px;
  overflow: hidden; padding: 0 10px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
  text-align: left; scroll-snap-align: center;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .18s, background .18s, box-shadow .18s, transform .18s;
}
.cv-tpl-poster {
  position: relative; display: block; margin: 0 -10px; overflow: hidden; border-bottom: 1px solid var(--line);
  background: var(--tpl-b); box-shadow: inset 0 -16px 0 rgba(255,255,255,.2);
}
.cv-tpl-poster::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 31%; background: var(--tpl-a); }
.cv-tpl-poster i { position: absolute; display: block; height: 3px; border-radius: 99px; background: rgba(255,255,255,.8); }
.cv-tpl-poster i:nth-child(1) { top: 19px; left: 42%; width: 40%; }
.cv-tpl-poster i:nth-child(2) { top: 30px; left: 42%; width: 30%; }
.cv-tpl-poster i:nth-child(3) { top: 48px; left: 42%; width: 46%; background: rgba(255,255,255,.6); }
.cv-tpl-meta { display: flex; align-items: center; gap: 7px; min-width: 0; }
.cv-tpl-meta em { color: var(--fg-3); font-family: var(--mono); font-size: 9px; font-style: normal; }
.cv-tpl-meta b { overflow: hidden; color: var(--fg); font-size: var(--fs-xs); font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.cv-tpl-desc { min-height: 30px; color: var(--fg-3); font-size: 10px; line-height: 1.45; }
.cv-tpl:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.cv-tpl.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.cv-tpl.on .cv-tpl-meta b { color: var(--accent); }
.cv-tpl-current { display: flex; align-items: baseline; gap: 8px; min-height: 20px; margin: 2px 37px 0; color: var(--fg-3); }
.cv-tpl-current b { color: var(--fg); font-size: var(--fs-xs); }
.cv-tpl-current span { font-size: 10.5px; }
/* ---------------- 版本管理 ---------------- */
.cv-vers {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2);
  margin-top: var(--s3);
  padding-top: var(--s3);
  border-top: 1px dashed var(--line);
}
.cv-vers-k { font-size: var(--fs-micro); font-weight: 600; color: var(--fg-2); }
.cv-select {
  max-width: 260px; height: 32px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--fg);
  font-family: inherit; font-size: var(--fs-xs);
}
.cv-select:focus { border-color: var(--accent-line); box-shadow: var(--ring); outline: none; }

.btn.small { height: 32px; padding: 0 10px; font-size: var(--fs-micro); font-weight: 600; }

/* 导入按钮：label 伪装成 btn，真正的 input 藏起来 */
.cv-file { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.cv-file input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}

/* ---------------- 岗位匹配 ---------------- */
.cv-jd-in {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg); color: var(--fg);
  font-family: inherit; font-size: var(--fs-xs); line-height: 1.7;
  resize: vertical; outline: none;
}
.cv-jd-in:focus { border-color: var(--accent-line); box-shadow: var(--ring); background: var(--surface); }
.cv-jd-in::placeholder { color: var(--fg-3); opacity: 0.75; }

.cv-jd-res { margin-top: var(--s3); }
.cv-jd-sum {
  margin: 0 0 8px;
  font-size: var(--fs-xs); line-height: 1.7; color: var(--fg-2);
}
.cv-jd-sum b { color: var(--fg); font-family: var(--mono); }
.cv-jd-row {
  display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px;
  align-items: start; margin-bottom: 6px;
}
.cv-jd-row > span { font-size: 10px; font-weight: 700; color: var(--fg-3); padding-top: 4px; }
.cv-jd-row > div { display: flex; flex-wrap: wrap; gap: 4px; }
.cv-jd-chip {
  padding: 0 7px; line-height: 22px; border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg-2);
  font-size: 11px; text-decoration: none;
  transition: border-color 0.14s, color 0.14s;
}
.cv-jd-chip.ok { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.cv-jd-chip.gap { border-style: dashed; color: var(--fg-3); }
.cv-jd-chip.na { border-style: dotted; color: var(--fg-3); background: var(--bg); cursor: default; }
.cv-jd-chip.na:hover { border-color: var(--line-2); color: var(--fg-3); }
.cv-jd-chip:hover { border-color: var(--accent); color: var(--accent); }
.cv-jd-note {
  margin: 8px 0 0;
  font-size: 10.5px; line-height: 1.6; color: var(--fg-3);
}

/* ===========================================================
   话术库
   =========================================================== */

.cv-tips {
  margin-top: var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.cv-tips > summary {
  padding: var(--s3) var(--s5);
  cursor: pointer;
  font-size: var(--fs-sm); font-weight: 600; color: var(--fg);
  list-style: none;
}
.cv-tips > summary::before {
  content: "＋"; margin-right: 8px; color: var(--accent); font-weight: 700;
}
.cv-tips[open] > summary::before { content: "－"; }
.cv-tips > summary:hover { color: var(--accent); }

.cv-tips-in { padding: 0 var(--s5) var(--s4); }
.cv-tips-g { margin-bottom: var(--s3); }
.cv-tips-g:last-of-type { margin-bottom: 0; }
.cv-tips-gn {
  display: inline-block; margin-bottom: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  color: var(--fg-3); text-transform: uppercase;
}
.cv-tips-list { display: flex; flex-wrap: wrap; gap: 5px; }
.cv-tip {
  padding: 4px 9px;
  border: 1px dashed var(--line-2); border-radius: 4px;
  background: var(--bg); color: var(--fg-2);
  font-family: inherit; font-size: 11.5px; line-height: 1.6; text-align: left;
  cursor: pointer;
  transition: border-color 0.14s, color 0.14s, background 0.14s;
}
.cv-tip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
