/* ============ 自托管字体（SIL OFL 1.1，可商用/可嵌入，许可见 assets/licenses/） ============ */
@font-face { font-family: 'Noto Sans SC'; font-style: normal; font-weight: 400; font-display: swap; src: url('./assets/fonts/NotoSansSC-Regular.woff') format('woff'); }
@font-face { font-family: 'Noto Sans SC'; font-style: normal; font-weight: 700; font-display: swap; src: url('./assets/fonts/NotoSansSC-Bold.woff') format('woff'); }
@font-face { font-family: 'Noto Serif SC'; font-style: normal; font-weight: 400; font-display: swap; src: url('./assets/fonts/NotoSerifSC-Regular.woff') format('woff'); }
@font-face { font-family: 'Noto Serif SC'; font-style: normal; font-weight: 700; font-display: swap; src: url('./assets/fonts/NotoSerifSC-Bold.woff') format('woff'); }
/* LXGW WenKai（霞鹜文楷）为分片按需加载，@font-face 见 assets/fonts/lxgw-wenkai.css */

/* ====================== 设计变量 ====================== */
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --line: #e8eaef;
  --line-strong: #d7dbe3;
  --text: #1a1d23;
  --text-2: #545c6b;
  --muted: #8b95a5;
  --primary: #2f6bff;
  --primary-d: #1f54d6;
  --primary-soft: #eef3ff;
  --soft: #f7f9fc;
  --ok: #18a058;
  --warn: #c2700a;
  --r-lg: 14px;
  --r: 10px;
  --r-sm: 8px;
  --sh-1: 0 1px 2px rgba(16, 24, 40, .05);
  --sh-2: 0 4px 16px rgba(16, 24, 40, .08);
  --sh-3: 0 12px 40px rgba(16, 24, 40, .14);
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: "Noto Sans SC", sans-serif;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; }

/* ====================== 顶栏 ====================== */
.topbar {
  position: sticky; top: 0; z-index: 30; height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 20px; background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; letter-spacing: .3px; }
.logo {
  width: 26px; height: 26px; border-radius: 8px; font-size: 12px;
  background: linear-gradient(135deg, #2f6bff, #7aa2ff); color: #fff;
  display: grid; place-items: center;
}
.top-right { display: flex; align-items: center; gap: 10px; }
.save-hint { font-size: 11px; color: var(--ok); opacity: 0; transition: .2s; }
.save-hint.on { opacity: 1; }

/* 分段控件（字体 / 字号） */
.seg { display: flex; gap: 2px; padding: 2px; background: var(--soft); border: 1px solid var(--line); border-radius: 9px; }
.seg-btn {
  border: none; background: transparent; color: var(--text-2); font-size: 12px;
  padding: 5px 11px; border-radius: 7px; cursor: pointer; transition: .15s; white-space: nowrap;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.on { background: #fff; color: var(--primary); font-weight: 600; box-shadow: var(--sh-1); }

/* 按钮 */
.btn {
  cursor: pointer; border: 1px solid var(--line-strong); background: #fff; color: var(--text);
  border-radius: var(--r-sm); padding: 7px 13px; font-size: 13px; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--primary-d); border-color: var(--primary-d); color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }
.exp-group { display: flex; gap: 6px; }

/* ====================== 步骤进度条 ====================== */
.steps {
  display: flex; align-items: center; gap: 2px; padding: 12px 20px;
  background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto;
}
.steps::-webkit-scrollbar { height: 0; }
.step {
  display: flex; align-items: center; gap: 7px; flex: none;
  padding: 4px 9px; border-radius: 20px; cursor: pointer; transition: .15s;
}
.step:hover { background: var(--soft); }
.step i {
  width: 22px; height: 22px; border-radius: 50%; font-style: normal; font-size: 12px;
  display: grid; place-items: center; background: #eef0f4; color: var(--muted); transition: .15s;
}
.step span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.step.done i { background: #e4f4ea; color: var(--ok); }
.step.done span { color: var(--text-2); }
.step.active { background: var(--primary-soft); }
.step.active i { background: var(--primary); color: #fff; }
.step.active span { color: var(--primary); font-weight: 600; }
.step-line { flex: 1 1 10px; min-width: 8px; height: 2px; background: var(--line); border-radius: 2px; }
.step-line.done { background: #c6e7d3; }

/* ====================== 主工作区 ====================== */
.work {
  display: grid; grid-template-columns: minmax(380px, 460px) 1fr;
  gap: 18px; padding: 18px 20px; align-items: start; max-width: 1680px; margin: 0 auto;
}
.work > *, .panel, .preview-pane, .paper-wrap { min-width: 0; }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-1); padding: 22px 24px; min-height: 72vh;
  display: flex; flex-direction: column;
}
.panel h2 { margin: 0 0 6px; font-size: 19px; font-weight: 700; letter-spacing: .3px; }
.panel .sub { color: var(--text-2); font-size: 13px; margin-bottom: 18px; line-height: 1.65; }

/* 表单控件 */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 13px; }
.field > span { color: var(--text-2); font-size: 12px; }

/* 信息步：每个字段一张小卡——头部为勾选芯片 + 缺失标签，输入框独立占满整行 */
.fld-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.fld-line {
  min-width: 0; padding: 8px 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.fld-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fld-head .choice { padding: 5px 10px; font-size: 12.5px; }
.fld-head .choice:hover { transform: none; }
.fld-line .field { margin: 0; }
.fld-line[data-fkey="measure"] { grid-column: 1 / -1; }
.miss-tag {
  display: none; flex: none; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; color: #fff; background: #e05666;
}
/* 排序按钮（字段卡片 & 模块列表共用） */
.fld-ops { display: inline-flex; gap: 4px; margin-left: auto; }
.fld-btn {
  width: 24px; height: 22px; padding: 0; line-height: 1; font-size: 13px;
  border: 1px solid var(--line-strong); border-radius: 6px; background: #fff;
  color: var(--text-2); cursor: pointer; transition: .12s;
}
@media (hover: hover) {
  .fld-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
  .fld-btn:disabled:hover { border-color: var(--line-strong); color: var(--text-2); background: #fff; }
}
.fld-btn:active:not(:disabled) { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.fld-btn:disabled { opacity: .35; cursor: not-allowed; }
/* 触屏浏览器点击后会把 :hover 粘在按钮上，这里强制恢复默认样式 */
@media (hover: none) {
  .fld-btn:hover, .fld-btn:disabled:hover { border-color: var(--line-strong); color: var(--text-2); background: #fff; }
}
/* 模块排序列表 */
.sec-order { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.sec-line {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  font-size: 13px;
}
.sec-label { font-weight: 600; color: var(--text); }
.sec-ops { display: inline-flex; gap: 4px; }
.fld-line.missing { border-color: #e05666; box-shadow: 0 0 0 3px rgba(224, 86, 102, .12); animation: shake .3s; }
.fld-line.missing .choice { color: #e05666; border-color: #f3b6bd; }
.fld-line.missing .field input, .fld-line.missing .field select {
  border-color: #e05666 !important; box-shadow: 0 0 0 3px rgba(224, 86, 102, .13);
}
.fld-line.missing .miss-tag { display: inline-block; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
@media (max-width: 760px) { .fld-grid { grid-template-columns: 1fr; } }
.field input, .field select, .field textarea {
  width: 100%; font-size: 13px; padding: 9px 11px; color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; transition: .15s;
}
.field select {
  appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%238b95a5' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.field textarea { resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 107, 255, .12);
}
.field input::placeholder, .field textarea::placeholder { color: #b6bdc9; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 三围 / 四围：选完展开对应输入框 */
.measure-row { display: flex; gap: 8px; margin-top: 8px; }
.m-item { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.m-item input {
  width: 100%; font-size: 13px; padding: 8px 9px; color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; transition: .15s;
}
.m-item input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 107, 255, .12); }

/* 勾选小项 */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.choice {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 13px;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: #fff;
  cursor: pointer; user-select: none; transition: .15s;
}
.choice:hover { border-color: #b9c8ee; background: #fbfcff; transform: translateY(-1px); }
.choice.checked { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.choice input { accent-color: var(--primary); margin: 0; }

/* 分组标题 */
.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 20px 0 12px; padding-top: 16px; border-top: 1px dashed var(--line);
}
.section-head:first-of-type { border-top: none; padding-top: 0; }
.section-head h3 { margin: 0; font-size: 14px; font-weight: 600; }

/* AI 按钮 */
/* AI 未配置时：置灰提示，hover 用 title 显示原因 */
.btn-ai.ai-off { opacity: .5; cursor: not-allowed; }
.btn-ai {
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
  background: linear-gradient(135deg, #eef3ff, #f8f1ff); color: #4a5bd6;
  border: 1px solid #dbe3ff; border-radius: var(--r-sm);
  padding: 6px 12px; font-size: 12px; font-weight: 600; transition: .15s;
}
.btn-ai:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(47, 107, 255, .18); }
.btn-ai:disabled { opacity: .6; transform: none; box-shadow: none; }

/* 选项卡片（类型 / 模板） */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card-opt {
  position: relative;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 14px;
  background: #fff; cursor: pointer; transition: .15s;
}
.card-opt:hover { border-color: #c3d3f7; box-shadow: var(--sh-2); transform: translateY(-2px); }
.card-opt.sel { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 107, 255, .1); }

/* 套餐锁定：精简版下不可选的模板仍展示（体现完整版价值），但置灰并标注 */
.card-opt.locked { background: #fafbfc; cursor: not-allowed; }
.card-opt.locked:hover { border-color: var(--line); box-shadow: none; transform: none; }
.card-opt.locked .mini { opacity: .45; }
.card-opt.locked::after {
  content: '完整版';
  position: absolute; top: 8px; right: 8px;
  padding: 2px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 600; color: var(--muted);
  background: #eef2f7; border: 1px solid var(--line);
}
.card-opt.compact.locked::after { top: 4px; right: 4px; padding: 1px 5px; font-size: 9px; }
.card-opt .t { font-weight: 600; margin-bottom: 4px; font-size: 14px; }
.card-opt .d { font-size: 12px; color: var(--text-2); line-height: 1.5; }

/* 模板缩略图（版式骨架，不缩放真实 DOM） */
.mini {
  height: 92px; display: flex; gap: 8px; padding: 12px; margin-bottom: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden;
}
.mini i { display: block; height: 5px; border-radius: 3px; background: #e6e9ef; margin-bottom: 6px; }
.mini b { display: block; height: 11px; width: 44%; border-radius: 4px; background: #3a4250; margin-bottom: 8px; }
.mini.layout-one { flex-direction: column; }
.mini.layout-two .m-side { width: 34%; border-right: 1px solid var(--line); padding-right: 8px; }
.mini.layout-two .m-main { flex: 1; }
.mini.tpl-classic b { background: #7a5c00; }
.mini.tpl-classic i { background: #eee9db; }
.mini.tpl-twocol { background: #fbfcfe; }
.mini.tpl-twocol b { background: #111111; }
.mini.tpl-safe b { background: #444444; }

/* ====================== 版式库（assets/templates/or-variants.css） ====================== */
/* 版式库模式下由该表接管排版，这里只覆盖纸张/导出相关的少数属性 */
#resume.resume-paper {
  padding: 8.5mm 9.5mm;
  font-size: var(--resume-size, 13px);
  line-height: var(--resume-line, 1.65);
  font-family: var(--resume-font, "Noto Sans SC", sans-serif);
  box-sizing: border-box;
  overflow: hidden;            /* 版式背景装饰层需要裁切 */
}
.resume.resume-paper:not(.in-pane) { box-shadow: none; }

/* 版式库选择 UI */
.sec-label {
  margin: 18px 0 10px; font-size: 13px; font-weight: 700; color: var(--text);
  display: flex; align-items: baseline; gap: 8px;
}
.sec-label span { font-weight: 400; font-size: 12px; color: var(--muted); }
.cards.or-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(102px, 1fr)); gap: 10px; }
.card-opt.compact { padding: 8px 6px; text-align: center; }
.card-opt.compact .t { margin-top: 6px; font-size: 12px; }

/* 版式缩略图：按版式实际使用的背景装饰分为 横幅 / 侧栏 / 素版 三类 */
.mini.or-mini {
  position: relative; height: 78px; flex-direction: column; justify-content: flex-start;
  padding: 10px 10px 4px; gap: 0;
}
.mini.or-mini::before { content: ''; position: absolute; background: var(--c, #475569); }
.mini.or-mini.m-banner::before { left: 0; top: 0; width: 100%; height: 24%; }
.mini.or-mini.m-rail::before { left: 0; top: 0; width: 16%; height: 100%; }
.mini.or-mini.m-plain::before { left: 10px; top: 30px; width: 34%; height: 3px; }
.mini.or-mini.m-banner { padding-top: 26%; }
.mini.or-mini.m-rail { padding-left: 22%; }
.mini.or-mini i { margin-bottom: 5px; }
.mini.or-mini b { width: 52%; height: 10px; background: #c9cfd8; }

/* 主题色选择器 */
.swatches { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.sw {
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer; padding: 0;
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); transition: transform .12s;
}
.sw:hover { transform: scale(1.18); }
.sw.on { box-shadow: 0 0 0 2px var(--text); transform: scale(1.12); }

/* ====================== 引导态（首次访问展示示例预览） ====================== */
.resume.is-sample { position: relative; }
.resume.is-sample::after {
  content: '示例';
  position: absolute; top: 10px; right: 10px; z-index: 5;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; letter-spacing: 1px; color: #6b7280;
  background: rgba(255, 255, 255, .92); border: 1px solid #d5dae2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}
.sample-cta {
  margin-top: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 12px;
  background: #f6f8fb; border: 1px dashed var(--line-strong); border-radius: var(--r-sm);
}
.sample-cta span { flex: 1; font-size: 12px; line-height: 1.6; color: var(--muted); }
.sample-cta .btn { flex: none; white-space: nowrap; }

/* 精简版的升级入口：替代被隐藏的版式库与主题色区 */
.upsell {
  margin-top: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 12px;
  background: #f6f8fb; border: 1px dashed var(--line-strong); border-radius: var(--r-sm);
}
.upsell span { flex: 1; font-size: 12px; line-height: 1.6; color: var(--muted); }
.upsell .btn { flex: none; white-space: nowrap; }

/* 列表块（经历 / 教育） */
.block {
  position: relative; border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 14px 12px; margin-bottom: 12px; background: #fff; transition: .15s;
}
.block:hover { border-color: var(--line-strong); box-shadow: var(--sh-1); }
.block .del {
  position: absolute; top: 8px; right: 8px; border: none; background: none;
  font-size: 12px; color: var(--muted); cursor: pointer; padding: 4px 6px; border-radius: 6px;
}
.block .del:hover { color: #e5484d; background: #fff1f1; }
.add-btn {
  width: 100%; padding: 11px; border: 1px dashed var(--line-strong); border-radius: var(--r);
  background: #fcfdff; color: var(--primary); font-size: 13px; font-weight: 500; cursor: pointer; transition: .15s;
}
.add-btn:hover { border-color: var(--primary); background: var(--primary-soft); }

/* 头像 */
.avatar-row { display: flex; gap: 16px; align-items: center; }
.avatar-box {
  width: 100px; height: 100px; border-radius: 50%; border: 2px dashed var(--line-strong);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  color: var(--muted); font-size: 12px; background: var(--soft);
}
.avatar-box img { width: 100%; height: 100%; object-fit: cover; }

/* 矢量 PDF：背景层只保留色块/边框/头像，文字走矢量 */
.pdf-bg, .pdf-bg * { color: transparent !important; text-shadow: none !important; }

/* 提示条 / 空状态 */
.tip-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--soft); border: 1px solid var(--line); border-radius: var(--r);
  padding: 9px 12px; margin-bottom: 14px; font-size: 12px; color: var(--text-2);
}
.tip-bar b { color: var(--text); }
.empty { text-align: center; padding: 30px 16px; color: var(--muted); font-size: 13px; }
.empty .ico { display: block; font-size: 26px; margin-bottom: 8px; }

/* 完成度 */
.done-box {
  margin-top: 18px; padding: 13px 15px;
  background: var(--soft); border: 1px solid var(--line); border-radius: var(--r);
}
.done-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.done-top b { color: var(--primary); font-size: 13px; }
.done-bar { height: 5px; background: #e6e9ef; border-radius: 5px; overflow: hidden; }
.done-bar > i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #2f6bff, #6b9bff); transition: width .3s; }
.done-tips { margin-top: 8px; font-size: 12px; color: var(--muted); line-height: 1.6; }

/* 完成页高亮提示（预览 / 导出说明） */
.done-hl {
  margin: 14px 0 16px; padding: 13px 15px;
  border-radius: var(--r); background: var(--primary-soft);
  border-left: 4px solid var(--primary);
  color: #17417f; font-size: 15px; font-weight: 700; line-height: 1.75;
}
.done-hl b { color: var(--primary); font-size: 16px; font-weight: 800; }
.done-hl.ok { background: #f0fbf4; border-left-color: var(--ok); color: #14663a; }
.done-hl.ok b { color: var(--ok); }
.done-export {
  padding: 15px; border-radius: 12px; background: #fff;
  border: 1.5px solid var(--primary); box-shadow: 0 0 0 3px rgba(47, 107, 255, .1);
}
.done-export-t { font-size: 16px; font-weight: 800; color: var(--primary); margin-bottom: 11px; }
.done-export-list { display: flex; flex-wrap: wrap; gap: 10px; }
.exp-chip {
  display: inline-flex; align-items: baseline; gap: 7px;
  padding: 9px 13px; border-radius: 999px;
  background: var(--primary-soft); color: #17417f;
  font-size: 14px; font-weight: 600;
}
.exp-chip b { font-size: 15px; font-weight: 800; color: var(--primary); }

/* 底部导航 */
/* 导航按钮栏：吸附在面板底部，长表单滚动时始终可见，无需拉到页尾 */
.actions {
  display: flex; justify-content: space-between; gap: 10px;
  margin-top: auto; padding: 12px 24px 18px;
  margin-left: -24px; margin-right: -24px; margin-bottom: -22px;
  position: sticky; bottom: 0; z-index: 5;
  background: var(--card);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 14px rgba(16, 24, 40, .05);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.nav-btn {
  cursor: pointer; border-radius: var(--r-sm); padding: 10px 20px; font-size: 13px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--text); transition: .15s;
}
.nav-btn:hover { border-color: var(--primary); color: var(--primary); }
.nav-btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.nav-btn.primary:hover { background: var(--primary-d); color: #fff; }
.nav-btn.ghost { color: var(--text-2); background: #fff; }

/* ====================== 预览区 ====================== */
.preview-pane { position: sticky; top: 78px; }
.pv-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; margin-bottom: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1);
}
.pv-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pv-title { font-size: 12px; font-weight: 600; color: var(--text-2); }
.pv-tools { display: flex; align-items: center; gap: 4px; }
.pv-btn {
  min-width: 28px; height: 28px; padding: 0 8px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; border-radius: 7px;
  font-size: 13px; color: var(--text-2); transition: .15s;
}
.pv-btn:hover { border-color: var(--primary); color: var(--primary); }
.pv-btn.wide { font-size: 12px; }
.zoom-val { font-size: 11px; color: var(--muted); min-width: 40px; text-align: center; }
.page-warn { font-size: 12px; color: var(--muted); }
.page-warn.warn { color: var(--warn); font-weight: 600; }
.paper-wrap {
  display: flex; justify-content: center; overflow: auto; padding: 10px;
  max-height: calc(100vh - 170px); background: #eceff4;
  border: 1px solid var(--line); border-radius: 12px;
}

/* ====================== 简历纸张 ====================== */
.resume {
  flex: none; width: 794px; min-height: 1123px; background: #fff; color: #222;
  padding: 52px 58px; font-size: var(--fs, 13px); line-height: 1.75;
  transform-origin: top center; box-shadow: var(--sh-3);
  position: relative;
}
/* zoom 会同时缩小布局尺寸，避免固定 794px 纸张把手机视口横向撑开 */
.resume.in-pane { zoom: var(--scale, .62); }
.size-small { --fs: 12px; }
.size-medium { --fs: 13px; }
.size-large { --fs: 15px; }
.font-sans { font-family: "Noto Sans SC", sans-serif; }
.font-serif { font-family: "Noto Serif SC", serif; }
.font-kai { font-family: "LXGW WenKai", "Noto Sans SC", serif; }

.resume h1 { font-size: 2.05em; line-height: 1.25; margin: 0 0 .12em; font-weight: 700; letter-spacing: .5px; }
.resume .r-sub { color: var(--accent, #2f6bff); font-size: 1.05em; font-weight: 500; margin-bottom: .35em; }
.resume .r-contact { display: flex; flex-wrap: wrap; gap: .3em 1.1em; color: #6b7280; font-size: .92em; margin-bottom: 1.3em; }
.resume h2 {
  font-size: 1.15em; font-weight: 700; line-height: 1.35; margin: 1.35em 0 .5em;
  padding-left: .6em; border-left: 3px solid var(--accent, #2f6bff);
}
.resume p { margin: 0; white-space: pre-wrap; }
.resume .item { margin-bottom: .95em; }
.resume .item .top { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; font-weight: 600; font-size: 1.02em; }
.resume .item .meta { color: #6b7280; font-size: .9em; font-weight: 400; }
.resume ul { margin: .35em 0 0; padding-left: 1.35em; }
.resume li { margin-bottom: .18em; }
.resume .skill {
  display: inline-block; background: #f1f3f7; color: #333; border-radius: 6px;
  padding: .2em .7em; margin: 0 .4em .4em 0; font-size: .92em;
}
/* 自有模板（单栏）：头像绝对定位在纸面右上角，不参与文档流 */
.resume .avatar-lg {
  position: absolute; top: 52px; right: 58px; width: 92px; height: 92px;
  object-fit: cover; border-radius: 10px; background: #f1f3f7; margin: 0;
}
/* 双栏/模特版式：头像回到文档流，置于左侧栏顶部 */
.resume .two .side .avatar-lg {
  position: static; width: 120px; height: 120px; margin: 0 0 12px;
}
/* 有头像时给联系行留出避让空间，避免长联系行压到照片下面（单栏） */
.resume.has-avatar .r-contact { padding-right: 104px; }
/* 空头像占位：不可见但保留空间，保证各版式上传头像前后排版零位移
   （wave/leftbar/capsule 用 order 把照片排在名字前，ribbon 用网格固定列，
    不占位的话一上传头像整个头部都会被挤动） */
.resume .classic-photo:empty {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.resume .two { display: grid; grid-template-columns: 232px 1fr; gap: 24px; }
.resume .two .side { border-right: 1px solid var(--line); padding-right: 20px; }
.resume .two .side h2 { border-left: none; border-bottom: 2px solid var(--accent, #2f6bff); padding: 0 0 .3em; margin-top: 0; }

/* 模板差异 */
.resume.tpl-minimal h1 { letter-spacing: 1px; }
.resume.tpl-twocol .side { background: #fbfcfe; border-right: none; border-radius: 8px; padding: 16px 14px; }
.resume.tpl-classic h1 { text-align: center; letter-spacing: 3px; }
.resume.tpl-classic .r-sub, .resume.tpl-classic .r-contact { justify-content: center; text-align: center; }
.resume.tpl-classic h2 { border-left: none; border-bottom: 1px solid var(--accent, #7a5c00); padding: 0 0 .25em; }
.resume.tpl-safe h2 { border-left-color: #444; }
.resume.tpl-safe .skill { background: #f4f5f7; }

/* ====================== 弹层 / 提示 ====================== */
.modal {
  position: fixed; inset: 0; background: rgba(18, 22, 30, .45);
  display: flex; align-items: center; justify-content: center; z-index: 60; padding: 20px;
}
.modal.hidden, .full-view.hidden { display: none; }
.modal-box {
  background: var(--card); border-radius: var(--r-lg); padding: 22px;
  width: min(760px, 100%); max-height: 88vh; overflow: auto; box-shadow: var(--sh-3);
}
.modal-box h3 { margin: 0 0 14px; font-size: 16px; }
.modal-box .sub { color: var(--text-2); font-size: 12px; margin-top: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.diff-col { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.diff-t { font-size: 12px; color: var(--text-2); padding: 7px 11px; background: var(--soft); border-bottom: 1px solid var(--line); }
.diff-col pre { margin: 0; padding: 11px; font: 13px/1.7 inherit; white-space: pre-wrap; word-break: break-word; min-height: 100px; }
.diff-col .dot { margin-left: 6px; color: var(--primary); }
.exp-thumb { width: 100%; max-height: 50vh; object-fit: contain; background: var(--soft); border: 1px solid var(--line); border-radius: var(--r-sm); }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: #1f2329; color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .2s; z-index: 80;
  box-shadow: var(--sh-3); display: flex; align-items: center; gap: 10px;
}
.toast.show { opacity: 1; pointer-events: auto; }
.toast-btn { background: none; border: none; color: #8ab4ff; cursor: pointer; font: inherit; text-decoration: underline; }

/* 全屏预览 */
.full-view { position: fixed; inset: 0; background: var(--bg); z-index: 70; overflow: auto; padding: 14px; }
.full-view > .btn { float: right; margin-bottom: 10px; }
.full-inner { clear: both; display: flex; justify-content: center; }

/* 页脚 / 合规入口 */
.site-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 18px;
  padding: 14px 20px 26px; color: var(--muted); font-size: 12px;
}
.foot-link {
  padding: 0; border: none; background: none; color: var(--text-2);
  font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.foot-link:hover { color: var(--primary); }
.privacy p { margin: 0 0 10px; color: var(--text-2); font-size: 13px; line-height: 1.75; }

/* ====================== 响应式 ====================== */
@media (max-width: 1080px) {
  .work { grid-template-columns: 1fr; }
  .preview-pane { position: static; }
  .paper-wrap { max-height: none; }
}
@media (max-width: 760px) {
  .topbar { height: auto; flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .top-right { width: 100%; flex-wrap: wrap; }
  .steps { padding: 10px 12px; }
  .step span { font-size: 11px; }
  .panel { padding: 16px 14px; min-height: auto; }
  .actions { margin-left: -14px; margin-right: -14px; margin-bottom: -16px; padding-left: 14px; padding-right: 14px; }
  .row { grid-template-columns: 1fr; }
  .cards, .diff { grid-template-columns: 1fr; }
  .work { padding: 14px; }
}
/* 手机横屏：高度很小，压缩上下留白，保证预览和按钮仍然可用 */
@media (max-height: 500px) and (orientation: landscape) {
  .topbar { height: 48px; padding: 0 14px; }
  .steps { padding: 6px 12px; }
  .work { padding: 10px 14px; }
  .panel { min-height: 0; padding: 14px; }
  .panel h2 { margin-bottom: 4px; }
  .panel .sub { margin-bottom: 10px; }
  .pv-bar { padding: 6px 10px; margin-bottom: 8px; }
  .paper-wrap { padding: 8px; }
  .site-foot { padding-bottom: 12px; }
}
/* 横屏且宽度足够时恢复左右布局：左侧填写、右侧预览，预览区内部滚动 */
@media (max-height: 500px) and (orientation: landscape) and (min-width: 700px) {
  .work { grid-template-columns: minmax(300px, 38%) 1fr; }
  .preview-pane { position: sticky; top: 88px; }
  .paper-wrap { max-height: calc(100vh - 118px); }
}
