/* ================= 应用外壳 ================= */
:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --line: #e3e7ee;
  --text: #232a33;
  --muted: #6b7480;
  --primary: #1f5fae;
  --primary-2: #2f6fc0;
  --primary-soft: #eaf2fc;
  --ok: #1a7f37;
  --ok-bg: #e8f6ec;
  --warn: #9a6b00;
  --warn-bg: #fff6e0;
  --err: #b42318;
  --err-bg: #fdecea;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(20, 30, 45, .08), 0 8px 24px rgba(20, 30, 45, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.app-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 16px 24px 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.app-header h1 { margin: 0; font-size: 20px; }
.app-header .sub { color: var(--muted); font-size: 12.5px; }
.app-header .head-actions { display: flex; gap: 8px; }

/* ================= 进入页 ================= */
#landing {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  background: linear-gradient(120deg, #0d2440, #1f5fae, #1d7f7a, #123a5c);
  background-size: 300% 300%;
  animation: gradShift 14s ease infinite;
}
#landing.hidden { display: none; }
@keyframes gradShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
#landing-canvas { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.landing-card {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .65);
  box-shadow:
    0 24px 80px rgba(6, 20, 40, .35),
    0 0 60px rgba(90, 190, 255, .28);
  padding: 44px 52px;
  max-width: 620px;
  width: 100%;
  text-align: center;
  animation: landIn .5s ease;
}
@keyframes landIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
.landing-logo {
  font-size: 44px;
  line-height: 1;
  color: #1f5fae;
  display: inline-block;
  animation: floaty 3s ease-in-out infinite;
  text-shadow: 0 6px 24px rgba(31, 95, 174, .35);
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.landing-card h1 {
  margin: 14px 0 4px;
  font-size: 32px;
  letter-spacing: 4px;
  background: linear-gradient(120deg, #0d2440, #1f5fae 55%, #1d7f7a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.landing-sub { color: #5a6472; font-size: 15px; margin: 0 0 20px; }
.landing-feats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 26px; }
.landing-feats span {
  background: rgba(31, 95, 174, .08);
  border: 1px solid rgba(31, 95, 174, .18);
  color: #1f5fae;
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 13px;
  font-weight: 600;
}
.landing-btn {
  font-size: 15px;
  padding: 11px 36px;
  border-radius: 999px;
  background: linear-gradient(120deg, #1f5fae, #1d7f7a);
  border: none;
  color: #fff;
  box-shadow: 0 10px 30px rgba(31, 95, 174, .35);
  transition: transform .2s ease, box-shadow .2s ease;
}
.landing-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(31, 95, 174, .45); }
.landing-privacy { color: #8a94a2; font-size: 12px; margin: 16px 0 0; }
@media (prefers-reduced-motion: reduce) {
  #landing, .landing-card, .landing-logo { animation: none !important; }
}

.tab-bar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  display: flex;
  gap: 4px;
  position: sticky;
  top: 0;
  z-index: 20;
  overflow-x: auto;
}
.tab-btn {
  appearance: none;
  border: none;
  background: none;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-family: inherit;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.app-main { max-width: 1080px; margin: 0 auto; padding: 20px 24px 80px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.panel h3 { margin: 0 0 12px; font-size: 15px; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 24px 8px; text-align: center; }

/* 欢迎引导 */
.welcome {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #f2f8ff, #ffffff);
  border-color: #cfe0f5;
}
.welcome-text { flex: 1; min-width: 260px; font-size: 13.5px; }
.welcome-text b { font-size: 14.5px; }
.welcome-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 按钮与徽章 ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 7px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-2); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--primary); }
.btn.danger:hover { border-color: var(--err); color: var(--err); }
.btn.sm { padding: 3px 9px; font-size: 12px; border-radius: 6px; }

.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  white-space: nowrap;
}
.badge.st-ok { background: var(--ok-bg); color: var(--ok); }
.badge.st-warn { background: var(--warn-bg); color: var(--warn); }
.badge.st-pending { background: #eef1f5; color: var(--muted); }
.badge.src { background: var(--primary-soft); color: var(--primary); }

.tag {
  display: inline-block;
  background: #f1f4f8;
  color: #4a5565;
  border-radius: 4px;
  padding: 0 7px;
  font-size: 11.5px;
  margin: 2px 3px 2px 0;
}

.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
input[type="checkbox"] { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; }
input[type="text"], input[type="email"], select, textarea {
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 10px;
  background: #fff;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 95, 174, .12); }
textarea { resize: vertical; line-height: 1.55; }

/* ================= 素材库 ================= */
.lib-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.lib-toolbar .filters { display: flex; flex-wrap: wrap; gap: 6px; }
.lib-stat { color: var(--muted); font-size: 12.5px; margin-left: auto; }

.lib-group { margin-bottom: 18px; }
.lib-cat {
  font-size: 14px;
  font-weight: 700;
  padding: 6px 0 6px 10px;
  border-left: 3px solid var(--primary);
  margin-bottom: 8px;
}
.lib-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  background: #fff;
}
.lib-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.lib-id {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11.5px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 4px;
  padding: 0 5px;
  margin-right: 3px;
}
.lib-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lib-note { color: var(--warn); font-size: 12px; margin-top: 5px; }
.lib-bullets { margin-top: 6px; }
.lib-bullet { font-size: 12.8px; margin: 2px 0; color: #3a4350; }
.lib-label { color: var(--muted); }
.lib-metric { color: var(--primary); font-weight: 600; }
.lib-tags { margin-top: 6px; }

/* 编辑抽屉 */
.lib-editor {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(560px, 94vw);
  background: var(--panel);
  box-shadow: -8px 0 32px rgba(20, 30, 45, .16);
  z-index: 60;
  transform: translateX(105%);
  transition: transform .22s ease;
  overflow-y: auto;
  padding: 20px 22px;
}
.lib-editor.open { transform: translateX(0); }
.editor-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 35, .35);
  z-index: 55; display: none;
}
.lib-editor.open ~ .editor-backdrop { display: block; }

/* 粘贴导入弹窗 */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 35, .4);
  z-index: 80; display: none;
}
.modal-backdrop.open { display: block; }
.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -46%);
  width: min(680px, 94vw);
  max-height: 86vh;
  overflow-y: auto;
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 18px 60px rgba(20, 30, 45, .25);
  padding: 20px 22px;
  z-index: 85;
  display: none;
}
.modal.open { display: block; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-bottom: 10px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.form-grid input, .form-grid select { width: 100%; }
.editor-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* 导入说明 */
.import-help {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 4px 0 12px;
  background: #fbfcfe;
}
.import-help summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.import-help-body { margin-top: 10px; font-size: 13px; color: var(--text); }
.import-help-body p { margin: 6px 0; }
.import-help-body ul { margin: 4px 0; padding-left: 20px; }
.import-help-body li { margin: 3px 0; }
.import-help-body code {
  background: #eef1f6; border-radius: 4px; padding: 1px 5px; font-size: 12px;
  font-family: ui-monospace, Menlo, monospace;
}
.import-help-body pre {
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.5;
  font-family: ui-monospace, Menlo, monospace;
}

/* ================= JD分析 ================= */
.jd-input-panel textarea { width: 100%; min-height: 180px; }
.jd-input-panel .row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.jd-input-panel .row input { flex: 1; min-width: 180px; }
.jd-score {
  font-size: 14px;
  color: var(--text);
  background: var(--primary-soft);
  border: 1px solid #cfe0f5;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.jd-score b { font-size: 20px; color: var(--primary); margin: 0 4px; }
.jd-score.score-zero { border-color: #f3c6c2; background: var(--err-bg); }
.jd-score.score-zero b { color: var(--err); }
.hard-ok {
  background: var(--ok-bg);
  color: var(--ok);
  border-radius: 8px;
  padding: 9px 14px;
  margin-bottom: 10px;
  font-size: 13px;
}
.hard-fail {
  background: var(--err-bg);
  color: var(--err);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.7;
}

.kw-panel { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin-bottom: 14px; }
.kw-title { font-weight: 600; margin-bottom: 8px; font-size: 13.5px; }
.kw-row { display: flex; align-items: center; gap: 10px; margin: 5px 0; font-size: 12.8px; }
.kw-name { width: 108px; flex-shrink: 0; }
.kw-bar-wrap { flex: 1; background: #eef1f6; border-radius: 5px; height: 10px; overflow: hidden; }
.kw-bar { height: 100%; background: var(--primary); border-radius: 5px; }
.kw-count { width: 44px; text-align: right; color: var(--muted); font-size: 12px; }

.req-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 14px; }
.req-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; background: #fbfcfe; }
.req-title { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.req-card ul { margin: 0; padding-left: 18px; font-size: 12.5px; color: #3a4350; }
.req-card li { margin: 3px 0; }

.pref-box {
  background: var(--primary-soft);
  border: 1px solid #cfe0f5;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
}

.match-list { display: flex; flex-direction: column; gap: 10px; }
.match-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: #fff; }
.match-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.match-head .score { margin-left: auto; color: var(--primary); font-weight: 700; }
.match-kws { font-size: 12px; color: var(--muted); margin-top: 5px; }
.match-reason { font-size: 12.5px; color: #3a4350; margin-top: 6px; }
.match-reason div { margin: 2px 0; }

/* ================= 内容确认 ================= */
.confirm-progress {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-weight: 600; margin-bottom: 12px;
}
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.table tr.row-sel { background: #f2f8ff; }
.table select { padding: 4px 8px; font-size: 12.5px; max-width: 260px; }

/* ================= 构建与校验 ================= */
.build-tools { display: flex; flex-wrap: wrap; gap: 20px; }
.build-tools .block { flex: 1; min-width: 240px; }
.build-tools .block-title { font-weight: 600; margin-bottom: 8px; font-size: 13.5px; }
.build-tools .check { display: flex; align-items: center; margin: 5px 0; }
.build-count { margin-top: 10px; color: var(--muted); font-size: 13px; }
.build-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.build-actions .note { font-size: 12.5px; color: var(--muted); }

/* 构建面板：条目级开关与顺序 */
.bcat { margin-bottom: 10px; }
.bcat-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bitems { margin: 5px 0 0 16px; border-left: 2px solid var(--line); padding-left: 10px; }
.bitem {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; font-size: 12.8px; padding: 2px 0;
}
.bitem-actions { display: flex; gap: 4px; }
.photo-thumb {
  width: 60px; height: 80px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--line);
}

/* JD雷达图 */
.radar-wrap { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; background: #fff; }
.radar-title { font-weight: 600; margin-bottom: 10px; font-size: 14px; }
.radar-flex { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.radar-canvas-wrap { flex: 1; min-width: 300px; max-width: 520px; }
.radar-canvas-wrap canvas { width: 100%; height: auto; }
.radar-side { flex: 1; min-width: 260px; }
.radar-legend { display: flex; gap: 16px; font-size: 13px; margin-bottom: 8px; flex-wrap: wrap; }
.lg-jd { color: #1f5fae; font-weight: 600; }
.lg-cov { color: #d97706; font-weight: 600; }
.radar-note { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.radar-table { font-size: 12.5px; }
.radar-table th, .radar-table td { padding: 5px 8px; }

.val-summary { font-weight: 600; margin-bottom: 10px; }
.val-ok { color: var(--ok); background: var(--ok-bg); border-radius: 8px; padding: 10px 14px; }
.val-item { border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; font-size: 13px; }
.val-item.error { background: var(--err-bg); }
.val-item.warn { background: var(--warn-bg); }
.val-item.info { background: #eef4fb; }
.val-fix { color: var(--primary); margin-top: 4px; font-size: 12.5px; }

/* ================= 模板 ================= */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; }
.tpl-card {
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  background: #fff;
  transition: all .15s;
}
.tpl-card:hover { border-color: var(--primary-2); }
.tpl-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 95, 174, .14); }
.tpl-name { font-weight: 600; margin-top: 8px; font-size: 13.5px; }
.tpl-desc { color: var(--muted); font-size: 12px; margin-top: 2px; min-height: 32px; }
.tpl-check { color: var(--primary); font-size: 12px; font-weight: 600; margin-top: 4px; }

/* 模板迷你预览骨架 */
.tpl-preview {
  height: 118px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #e8ebf0;
  overflow: hidden;
  padding: 8px;
  --pv: #1f5fae;
}
.tpl-pv-blue { --pv: #1f5fae; }
.tpl-pv-mono { --pv: #333940; }
.tpl-pv-teal { --pv: #0e7c6b; }
.tpl-pv-orange { --pv: #d97706; }
.tpl-pv-green { --pv: #4d6b2e; }
.tpl-pv-wine { --pv: #8c1d40; }

.pv-head { height: 16px; background: var(--pv); border-radius: 3px; margin-bottom: 7px; }
.pv-body { display: flex; gap: 7px; }
.pv-side { width: 34%; background: color-mix(in srgb, var(--pv) 12%, #fff); border-radius: 3px; min-height: 76px; }
.pv-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.pv-lines i { height: 7px; background: #e3e7ee; border-radius: 3px; display: block; }
.pv-lines i:nth-child(1) { background: var(--pv); width: 52%; }
.pv-lines i:nth-child(4) { width: 80%; }
.tpl-pv-sidebar .pv-body { flex-direction: row; }
.tpl-pv-sidebar .pv-side { background: color-mix(in srgb, var(--pv) 20%, #fff); border: 1px solid color-mix(in srgb, var(--pv) 28%, #fff); }
.tpl-pv-classic .pv-side { display: none; }
.tpl-pv-classic .pv-head { width: 56%; margin: 0 auto 7px; }
.tpl-pv-twocol { border-top: 3px solid var(--pv); padding-top: 6px; }
.tpl-pv-twocol .pv-head { width: 68%; }
.tpl-pv-twocol .pv-body { align-items: stretch; }
.tpl-pv-twocol .pv-side { width: 50%; }
.tpl-pv-twocol .pv-lines { width: 50%; }
.tpl-pv-timeline .pv-head { width: 52%; margin-left: 14px; }
.tpl-pv-timeline .pv-lines { padding-left: 12px; border-left: 2px solid var(--pv); padding-top: 2px; }
.tpl-pv-timeline .pv-lines i { position: relative; }
.tpl-pv-timeline .pv-lines i::before {
  content: "";
  position: absolute;
  left: -14px; top: 1px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--pv);
}

/* ================= 预览与导出 ================= */
.preview-stage {
  background: #e7ebf0;
  border-radius: 12px;
  padding: 26px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  overflow-x: auto;
}
.preview-tools {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  justify-content: center; margin-bottom: 6px;
}
.preview-tools .page-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.resume {
  width: 794px;
  min-height: 1123px;
  background: #fff;
  color: #242a33;
  padding: 42px 46px;
  box-shadow: 0 6px 24px rgba(20, 30, 45, .14);
  font-size: 12.5px;
  line-height: 1.6;
  flex-shrink: 0;
}
.resume .page-start {
  margin-top: 54px;
  padding-top: 10px;
  border-top: 2px dashed #c9d1da;
}

/* ---------- 简历基础样式 ---------- */
.resume h1, .resume h2, .resume p { margin: 0; }
.resume .r-header { text-align: center; padding-bottom: 10px; border-bottom: 2px solid var(--ra, #1f5fae); margin-bottom: 12px; }
.resume .r-header { display: flex; align-items: center; gap: 20px; }
.resume .r-header-info { flex: 1; min-width: 0; text-align: center; }
.resume .r-name { font-size: 23px; letter-spacing: 4px; color: var(--rt, #1b2330); }
.resume .r-contact { font-size: 11.5px; color: var(--rm, #5a6472); margin-top: 3px; }
.resume .r-intent { font-size: 12px; color: var(--ra, #1f5fae); font-weight: 600; margin-top: 4px; }
.resume .r-photo {
  width: 88px; height: 116px; object-fit: cover; flex-shrink: 0;
  border: 1.5px solid var(--rc, #d9e2ec); border-radius: 5px;
}
.resume .r-section { margin-bottom: 13px; }
.resume .r-section-title {
  font-size: 14.5px;
  color: var(--ra, #1f5fae);
  border-bottom: 1.5px solid var(--ra, #1f5fae);
  padding-bottom: 3px;
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.resume .r-entry { margin-bottom: 9px; }
.resume .r-entry-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.resume .r-entry-title { font-weight: 700; font-size: 13px; }
.resume .r-entry-role { color: var(--rm, #5a6472); font-size: 12px; }
.resume .r-entry-period { margin-left: auto; color: var(--ra, #1f5fae); font-size: 12px; font-weight: 600; white-space: nowrap; }
.resume .r-bullet { margin: 2.5px 0 2.5px 14px; font-size: 12.3px; text-align: justify; }
.resume .r-bullet b { color: var(--rm, #5a6472); font-weight: 600; }
.resume .r-metric { color: var(--ra, #1f5fae); font-weight: 600; }
.resume .r-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.resume .r-chip {
  border: 1px solid var(--rc, #d9e2ec);
  color: var(--rt, #1b2330);
  border-radius: 4px;
  padding: 2px 9px;
  font-size: 11.5px;
  background: var(--rs, #f7fafd);
}

/* ---------- 4种版式 ---------- */
/* 版式一：经典单栏 —— 居中姓名、通栏内容、下划线分区 */
.resume.tpl-classic .r-header { border-bottom: 2px solid var(--ra, #1f5fae); }
.resume.tpl-classic .r-name { letter-spacing: 5px; }
.resume.tpl-classic .r-section-title { letter-spacing: 2px; }

/* 版式二：左侧信息栏 —— 彩色侧栏承载基本信息/技能/荣誉，右侧为主经历 */
.resume.tpl-sidebar { display: grid; grid-template-columns: 245px 1fr; column-gap: 26px; align-items: start; }
.resume.tpl-sidebar .r-header {
  grid-column: 1 / -1;
  text-align: left;
  border-bottom: 2px solid var(--ra, #1f5fae);
  padding-bottom: 8px;
}
.resume.tpl-sidebar .r-header-info { text-align: left; }
.resume.tpl-sidebar .r-name { letter-spacing: 2px; font-size: 21px; }
.resume.tpl-sidebar .r-side { grid-column: 1; }
.resume.tpl-sidebar .r-main { grid-column: 2; }
.resume.tpl-sidebar .r-side .r-section {
  background: var(--rs, #f2f7fd);
  border: 1px solid var(--rc, #cfe0f5);
  border-radius: 8px;
  padding: 9px 12px;
  margin-bottom: 10px;
}
.resume.tpl-sidebar .r-side .r-section-title {
  border-bottom: none;
  font-size: 13px;
  letter-spacing: 1px;
}

/* 版式三：现代双栏 —— 顶部强调色条 + 左右两栏均衡排版，自我评价通栏收尾 */
.resume.tpl-twocol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 30px;
  align-items: start;
  border-top: 5px solid var(--ra, #1f5fae);
}
.resume.tpl-twocol .r-header { grid-column: 1 / -1; text-align: left; border-bottom: none; margin-top: 6px; }
.resume.tpl-twocol .r-header-info { text-align: left; }
.resume.tpl-twocol .r-name { letter-spacing: 3px; font-size: 21px; }
.resume.tpl-twocol .r-cola { grid-column: 1; }
.resume.tpl-twocol .r-colb { grid-column: 2; }
.resume.tpl-twocol section[data-cat="summary"] { grid-column: 1 / -1; }
.resume.tpl-twocol .r-section-title { border-bottom: 2px solid var(--ra, #1f5fae); }

/* 版式四：时间线 —— 纵向时间轴、节点圆点、时间段胶囊 */
.resume.tpl-timeline .r-header { border-bottom: 2px double var(--ra, #1f5fae); }
.resume.tpl-timeline .r-name { color: var(--ra, #1f5fae); letter-spacing: 4px; }
.resume.tpl-timeline .r-section { position: relative; padding-left: 4px; }
.resume.tpl-timeline .r-entry { position: relative; padding-left: 26px; margin-bottom: 11px; }
.resume.tpl-timeline .r-entry::before {
  content: "";
  position: absolute;
  left: 0; top: 4px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--ra, #1f5fae);
}
.resume.tpl-timeline .r-entry::after {
  content: "";
  position: absolute;
  left: 4.5px; top: 19px; bottom: -13px;
  width: 2px;
  background: color-mix(in srgb, var(--ra, #1f5fae) 35%, transparent);
}
.resume.tpl-timeline .r-entry:last-child::after { display: none; }
.resume.tpl-timeline .r-entry-period {
  margin-left: auto;
  background: var(--rs, #f2f7fd);
  border: 1px solid var(--rc, #cfe0f5);
  border-radius: 999px;
  padding: 0 10px;
  font-size: 11px;
  color: var(--ra, #1f5fae);
}

/* ---------- 6种配色 ---------- */
.resume.tpl-classic-blue, .resume.tpl-sidebar-blue, .resume.tpl-twocol-blue, .resume.tpl-timeline-blue {
  --ra: #1f5fae; --rt: #1b2a3d; --rm: #55637a; --rc: #cfe0f5; --rs: #f2f7fd;
}
.resume.tpl-classic-mono, .resume.tpl-sidebar-mono, .resume.tpl-twocol-mono, .resume.tpl-timeline-mono {
  --ra: #333940; --rt: #17191d; --rm: #5b626b; --rc: #d9dde3; --rs: #f7f8f9;
}
.resume.tpl-classic-teal, .resume.tpl-sidebar-teal, .resume.tpl-twocol-teal, .resume.tpl-timeline-teal {
  --ra: #0e7c6b; --rt: #123b35; --rm: #46665f; --rc: #cdeae3; --rs: #f1f9f7;
}
.resume.tpl-classic-orange, .resume.tpl-sidebar-orange, .resume.tpl-twocol-orange, .resume.tpl-timeline-orange {
  --ra: #c96a0a; --rt: #3a2c1b; --rm: #7a6a56; --rc: #f3dcc2; --rs: #fdf7ef;
}
.resume.tpl-classic-green, .resume.tpl-sidebar-green, .resume.tpl-twocol-green, .resume.tpl-timeline-green {
  --ra: #4d6b2e; --rt: #24311a; --rm: #5d6a50; --rc: #dce8cc; --rs: #f7faF2;
}
.resume.tpl-classic-wine, .resume.tpl-sidebar-wine, .resume.tpl-twocol-wine, .resume.tpl-timeline-wine {
  --ra: #8c1d40; --rt: #331522; --rm: #77515f; --rc: #eccfd9; --rs: #fcf4f7;
}

/* ---------- 压缩到一页 ---------- */
.resume.compact {
  font-size: 10.5px;
  line-height: 1.5;
  padding: 22px 30px;
}
.resume.compact .r-header { margin-bottom: 7px; padding-bottom: 5px; }
.resume.compact .r-name { font-size: 18px; letter-spacing: 4px; }
.resume.compact .r-contact { font-size: 9.8px; margin-top: 2px; }
.resume.compact .r-intent { font-size: 10.5px; margin-top: 3px; }
.resume.compact .r-photo { width: 70px; height: 94px; }
.resume.compact .r-section { margin-bottom: 7px; }
.resume.compact .r-section-title { font-size: 12px; margin-bottom: 4px; padding-bottom: 2px; letter-spacing: 1px; }
.resume.compact .r-entry { margin-bottom: 5px; }
.resume.compact .r-entry-title { font-size: 11.5px; }
.resume.compact .r-entry-role { font-size: 10.5px; }
.resume.compact .r-entry-period { font-size: 10.5px; }
.resume.compact .r-bullet { font-size: 10.5px; margin: 1px 0 1px 10px; line-height: 1.45; text-align: left; }
.resume.compact .r-chips { gap: 4px; }
.resume.compact .r-chip { font-size: 9.8px; padding: 1px 7px; }
.resume.compact .page-start { margin-top: 34px; }
.resume.compact.tpl-sidebar { grid-template-columns: 210px 1fr; column-gap: 18px; }
.resume.compact.tpl-sidebar .r-side .r-section { padding: 7px 10px; margin-bottom: 8px; }
.resume.compact.tpl-sidebar .r-side .r-section-title { font-size: 11.5px; }
.resume.compact.tpl-twocol { column-gap: 22px; }
.resume.compact.tpl-timeline .r-entry { padding-left: 20px; margin-bottom: 6px; }
.resume.compact.tpl-timeline .r-entry::before { width: 9px; height: 9px; left: 0; top: 3px; border-width: 2px; }
.resume.compact.tpl-timeline .r-entry::after { left: 3.5px; top: 15px; bottom: -10px; }
.resume.compact.tpl-timeline .r-entry-period { padding: 0 8px; font-size: 9.8px; }

/* ================= 响应式与无障碍 ================= */
html { scroll-behavior: smooth; }
.btn:focus-visible, .tab-btn:focus-visible, .tpl-card:focus-visible, .check input:focus-visible {
  outline: 3px solid rgba(31, 95, 174, .55);
  outline-offset: 2px;
}
.preview-stage { -webkit-overflow-scrolling: touch; }

@media (max-width: 760px) {
  .app-header { padding: 12px 14px 10px; }
  .app-header h1 { font-size: 17px; }
  .app-header .sub { font-size: 11.5px; }
  .tab-bar { padding: 0 10px; }
  .tab-btn { padding: 10px 10px; font-size: 13px; }
  .app-main { padding: 14px 12px 60px; }
  .panel { padding: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .lib-toolbar .lib-stat { margin-left: 0; width: 100%; }
  .jd-input-panel .row { flex-direction: column; }
  .build-tools .block { min-width: 100%; }
  .lib-head { flex-direction: column; align-items: flex-start; }
  .lib-actions { flex-wrap: wrap; }
  .landing-card { padding: 30px 20px; max-height: 94vh; overflow-y: auto; }
  .landing-card h1 { font-size: 24px; letter-spacing: 2px; }
  .landing-logo { font-size: 36px; }
  .landing-feats span { font-size: 12px; padding: 4px 10px; }
  .landing-btn { font-size: 14px; padding: 10px 28px; }
  .preview-stage { padding: 14px 8px; }
  .tpl-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .modal { width: 96vw; padding: 16px 14px; }
  .table th, .table td { padding: 6px 8px; font-size: 12.5px; }
  .resume { width: 760px; }
}
@media (max-width: 420px) {
  .tab-btn { padding: 9px 8px; font-size: 12.5px; }
  .app-main { padding: 12px 10px 50px; }
  .panel { padding: 12px; }
  .resume { width: 720px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tab-panel { animation: none !important; }
}

/* ================= 打印适配 ================= */
@media print {
  body { background: #fff; }
  #landing { display: none !important; }
  .app-header, .tab-bar, .app-main > .panel:not(#panel-preview), .preview-tools, .preview-note, .lib-editor, .editor-backdrop { display: none !important; }
  .app-main { max-width: none; padding: 0; margin: 0; }
  .tab-panel { display: none !important; }
  #panel-preview { display: block !important; }
  #panel-preview, #panel-preview .panel {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
  }
  .preview-stage { background: #fff; padding: 0; border-radius: 0; }
  @page { size: A4 portrait; }
  .resume {
    width: 210mm;
    min-height: auto;
    box-shadow: none;
    padding: 10mm 12mm;
    margin: 0;
  }
  .resume.compact { padding: 7mm 10mm; }
  .resume .page-start { break-before: page; margin-top: 0; padding-top: 0; border-top: none; }
  .resume .r-entry, .resume .r-section-title, .resume .r-chips { break-inside: avoid; }
  .resume.tpl-sidebar .r-section, .resume.tpl-twocol .r-section { break-inside: avoid; }
  .resume .r-side, .resume .r-main, .resume .r-cola, .resume .r-colb { break-inside: auto; }
  .r-section { break-inside: auto; }
}
