/* 简历打印样式唯一事实来源：style.css 不再放简历打印规则（2026-07 原 style.css @media print
   简历块已并入本文件并去重）。屏幕态“纸张”预览样式在 assets/resume-preview.css。 */
@page { size: A4; margin: 10mm 12mm; }
@media print {
  /* ---------- 打印功能规则（与设计无关，勿动） ---------- */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html, body { background: #fff !important; color: #3c3833 !important; }

  /* ---------- 自 style.css @media print 简历块并入的全局重置（2026-07） ----------
     旧块中作用于 .resume 的字号/间距/照片/芯片等规则与本文件 --r-* 设计体系重复，
     按去重原则舍弃，一切以 --r-* 体系为准；此处只保留 --r-* 未覆盖的全局项。 */
  /* 打印强制浅色令牌：暗色主题的全站 token 是浅字深底。注意 :root 优先级低于 style.css 的
     :root[data-theme="dark"]，暗色下本就落选——与并入前行为一致，仅兜浅色/系统默认场景 */
  :root { --bg: #fff; --fg: #111; --muted: #555; --line: #ddd; --accent: #8a3d1e; --code-bg: #f5f5f5; --card: #fff; --ink: #333; --shadow: transparent; }
  /* 兜底字号：可见内容均由 --r-* 体系显式定字号，只兜未显式设置的元素（如 #print-lock-msg） */
  body { font-size: 12px; line-height: 1.4; }
  /* 抵消屏幕态 .resume { padding: 48px 0 64px }（style.css 无 media 属性，会渗入打印） */
  .resume { padding: 0; }
  body:not(.print-ok) #resume-preview, body:not(.print-ok) #public-resume { display: none !important; }
  body:not(.print-ok) #print-lock-msg { display: block !important; }
  body.print-ok #print-lock-msg { display: none !important; }
  .no-print, header.site, footer.site, #locked-view, .role-grid, .resume-options,
  .workbench-title, .source-panel, .editor-tools, .preview-empty { display: none !important; }
  .resume.editing::before { display: none !important; }
  .resume [data-edit-key] { outline: none !important; background: transparent !important; }
  .structure-control { display: none !important; }
  .workbench, #workbench-view { display: block !important; max-width: none; padding: 0; }
  #resume-preview {
    display: block; padding: 0; margin: 0; max-width: none;
  }
  #resume-preview .resume-block, #resume-preview .resume-project, #resume-preview .resume-experience {
    padding: 0 !important; margin-top: 0; margin-bottom: 0;
  }
  /* 全站 `section { padding: 52px 0 }` 会落到简历条目上（条目本身是 <section class="item">），打印必须清掉 */
  .resume section, .resume .item { padding: 0; }
  a { color: inherit; text-decoration: none; }
  h2, h3 { break-after: avoid; }
  .resume .contact-phone:empty { display: none !important; }

  /* ---------- 编辑型纸质简历设计（2026-07 同步） ---------- */
  /* 设计令牌：颜色 */
  .resume {
    --r-accent: #A34A22;   /* 强调色 */
    --r-ink:    #1c1a17;   /* 姓名与各级标题 */
    --r-body:   #3c3833;   /* 正文 */
    --r-body2:  #4a453f;   /* 次级正文 */
    --r-meta:   #6d665e;   /* 时间等元信息 */
    --r-mute:   #8d867d;   /* 行内弱化文字 */
    --r-label:  #a8a096;   /* 等宽体小标签 */
    --r-dash:   #bfb7ac;   /* 列表短横线 */
    --r-sep:    #c9c2b8;   /* 行内分隔点 */
    --r-rule:   #e6e1d9;   /* 章节延伸细线 */
    --r-hair:   #ece8e1;   /* 条目间分隔线 */
    --r-frame:  #e0dad1;   /* 证件照卡纸边 */
    --r-hard:   #2a2620;   /* 抬头下方实线 */
    /* 字体：不引入 Google Fonts，用系统回退栈（离线可用、国内可达） */
    --r-serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
    --r-sans:  "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    --r-mono:  "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
    /* 设计令牌：字号（两页完整版基准，一页版在文末整体缩档） */
    --fs-name: 23px;
    --fs-alias: 10.5px;
    --fs-headline: 11.8px;
    --fs-target: 9.8px;
    --fs-contact: 10.4px;
    --fs-h2: 10.6px;
    --fs-h3: 12.2px;
    --fs-time: 9.4px;
    --fs-role: 9.9px;
    --fs-body: 10.6px;
    --fs-body2: 10.2px;
    --fs-label: 8.4px;
    --lh-body: 1.4;

    font-family: var(--r-sans);
    color: var(--r-body);
    counter-reset: rsec;
  }

  /* 抬头：姓名 / 花名 / 一句话定位 / 联系方式，下方一条硬线收口 */
  .resume-head {
    display: flex; justify-content: space-between; align-items: flex-end;
    gap: 10mm; padding-bottom: 12px; margin-bottom: 2px;
    border-bottom: 1px solid var(--r-hard);
  }
  .resume-head-copy { flex: 1; min-width: 0; }
  .resume h1 {
    font: 600 var(--fs-name)/1.1 var(--r-serif);
    letter-spacing: .06em; color: var(--r-ink);
  }
  .resume h1 span {
    font: 400 var(--fs-alias)/1 var(--r-mono);
    letter-spacing: .08em; color: var(--r-label);
  }
  .resume .headline {
    font: 500 var(--fs-headline)/1.4 var(--r-serif);
    letter-spacing: .02em; color: var(--r-accent); margin-top: 6px;
  }
  .resume .target-role {
    font: 400 var(--fs-target)/1.5 var(--r-sans);
    color: var(--r-meta); font-weight: 400; margin-top: 3px;
  }
  .resume .contact {
    font-size: var(--fs-contact); line-height: 1.5;
    color: var(--r-body); margin-top: 6px;
  }
  .resume .contact span {
    margin: 0; padding: 0; border-right: 0;
  }
  .resume .contact span:not(:last-child)::after {
    content: "·"; color: var(--r-sep); padding: 0 5px;
  }
  .resume .contact a { font-weight: 400; }
  /* 证件照：4px 留白的卡纸框 */
  .resume-photo {
    display: block; flex: 0 0 auto; box-sizing: content-box;
    width: 25mm; height: 34mm; padding: 1mm;
    object-fit: cover; object-position: center 40%;
    background: #fff; border: .25mm solid var(--r-frame); border-radius: 0;
  }

  /* 章节标题：01 编号（等宽·强调色）+ 宋体宽字距标题 + 右侧延伸细线 */
  .resume h2 {
    display: flex; align-items: center; gap: 10px;
    font: 600 var(--fs-h2)/1 var(--r-serif);
    letter-spacing: .2em; text-transform: none; color: var(--r-ink);
    border: 0; padding: 0; margin: 11px 0 7px;
  }
  .resume h2::before {
    counter-increment: rsec;
    content: counter(rsec, decimal-leading-zero);
    flex: none;
    font: 500 var(--fs-label)/1 var(--r-mono);
    letter-spacing: .14em; color: var(--r-accent);
  }
  .resume h2::after {
    content: ""; flex: 1; height: 1px; background: var(--r-rule);
  }

  /* 条目：标题左、时间右（等宽体），条目之间用发丝线分隔 */
  .resume .item { margin-bottom: 0; break-inside: avoid; }
  .resume .item .row { display: flex; align-items: baseline; gap: 14px; }
  .resume .item h3 {
    flex: 1; min-width: 0;
    font: 600 var(--fs-h3)/1.3 var(--r-serif);
    letter-spacing: .01em; color: var(--r-ink);
  }
  .resume .item .time {
    flex: none; white-space: nowrap;
    font: 400 var(--fs-time)/1.3 var(--r-mono);
    letter-spacing: .03em; color: var(--r-meta);
    font-variant-numeric: tabular-nums;
  }
  .resume .item .role {
    font-size: var(--fs-role); line-height: 1.4; font-weight: 400;
    letter-spacing: .02em; color: var(--r-accent); margin: 2px 0 5px;
  }
  .resume .item + .item,
  .resume .resume-project + .resume-project,
  .resume .resume-experience + .resume-experience {
    margin-top: 8px; padding-top: 7px !important;
    border-top: 1px solid var(--r-hair);
  }

  /* 列表：短横线代替圆点 */
  .resume .item ul, .resume .highlights {
    list-style: none; padding-left: 16px; margin: 0;
    font-size: var(--fs-body); line-height: var(--lh-body);
  }
  .resume .item li, .resume .highlights li {
    position: relative; margin-bottom: 4px; text-wrap: pretty;
  }
  .resume .item li::marker, .resume .highlights li::marker { content: none; }
  .resume .item li::before, .resume .highlights li::before {
    content: ""; position: absolute; left: -16px; top: .68em;
    width: 7px; height: 1px; background: var(--r-dash);
  }

  /* 摘要与边界说明 */
  .resume .summary {
    font-size: var(--fs-body); line-height: var(--lh-body);
    color: var(--r-body); text-wrap: pretty;
  }
  .resume .boundary {
    font-size: var(--fs-body2); line-height: 1.5; color: var(--r-body2);
  }
  .resume .dynamic-note {
    font-size: var(--fs-body2); line-height: 1.5; color: var(--r-meta);
  }

  /* 能力与工具：等宽体标签挂在左侧栏，正文悬挂对齐 */
  .resume .skills-line {
    display: block !important; position: relative; gap: 0 !important;
    font-size: var(--fs-body2); line-height: 1.55; margin-bottom: 5px;
  }
  /* 只有带分组标签 <b> 的才让出左侧标签列：工作台把技能渲染成单条无标签的
     .skills-line（resume-system.js），无条件缩进会变成一整段空缩进 */
  .resume .skills-line:has(b) { padding-left: 84px; }
  /* 标签列用无衬线体：分组名是中文，等宽体回退栈渲染中文会挤字甚至叠字 */
  .resume .skills-line b {
    position: absolute; left: 0; top: 1px; width: 76px;
    font: 500 calc(var(--fs-label) + 1px)/1.5 var(--r-sans);
    letter-spacing: .04em; color: var(--r-label); font-weight: 500;
  }
  .resume .chip {
    color: var(--r-body); background: none; border: 0;
    border-radius: 0; padding: 0 !important; font-size: inherit;
  }
  .resume .skill-item:not(:last-child)::after {
    content: "·"; color: var(--r-sep); margin: 0 5px;
  }

  /* 教育背景 */
  .resume .edu-item h3 {
    font: 600 var(--fs-h3)/1.3 var(--r-serif); color: var(--r-ink);
  }
  .resume .edu-item .time { font-size: var(--fs-time); }
  .resume .edu-item p { font-size: var(--fs-body2); color: var(--r-body2); }

  /* ---------- 一页精简版：整体缩档，比例与两页版一致 ---------- */
  .resume[data-page-mode="one"] {
    --fs-name: 22px;
    --fs-alias: 10px;
    --fs-headline: 11.5px;
    --fs-target: 9.6px;
    --fs-contact: 10px;
    --fs-h2: 10.2px;
    --fs-h3: 11.8px;
    --fs-time: 9.2px;
    --fs-role: 9.6px;
    --fs-body: 10.3px;
    --fs-body2: 9.9px;
    --fs-label: 8.2px;
    --lh-body: 1.38;
    font-size: 10.3px;
  }
  .resume[data-page-mode="one"] .optional-two-page { display: none !important; }
  .resume[data-page-mode="one"] .resume-head { gap: 7mm; padding-bottom: 9px; }
  .resume[data-page-mode="one"] .resume-photo { width: 22mm; height: 30mm; }
  .resume[data-page-mode="one"] h2 { margin: 9px 0 6px; }
  .resume[data-page-mode="one"] .item { break-inside: auto; }
  .resume[data-page-mode="one"] .item .row,
  .resume[data-page-mode="one"] .item .role { break-after: avoid; }
  .resume[data-page-mode="one"] .item li { break-inside: avoid; margin-bottom: 2px; }
  .resume[data-page-mode="one"] .item + .item,
  .resume[data-page-mode="one"] .resume-project + .resume-project,
  .resume[data-page-mode="one"] .resume-experience + .resume-experience {
    margin-top: 7px; padding-top: 6px !important;
  }
  .resume[data-page-mode="one"] .skills-line { margin-bottom: 2px; }
}
