/* 板块 44 · 首页以 JD 档案为单元：档案框、轮次链、「+ 加下一轮」、岗位档案页顶部的加一轮、每一轮直接进入的一行、贴 JD 时认出已有岗位
   每条规则都挂在 .v3 下面（产品 css 每页都加载），test/v3-dossier-css.test.js 会查
   档案框是一张不浮起来的纸：细线描边、静止时没有阴影（整页只有「下一场」画布是托起来的）；轮次链直接用 v3 五步条的 .stages .stage .ix
   板块 51：档案区是网格（宽屏两列、手机一列），每格同样大；最后一格「新建约面」是虚线框 + 中间一个加号，点开在原位展开成整行
   轻动效：档案框依次浮现、hover 微微抬起；加号 hover 转四分之一圈、虚线圈慢慢转；展开时表单淡入；减少动态效果时全部关掉 */

/* ---------- 1 档案网格：每格同样大（grid-auto-rows: 1fr），框里上下撑开，底部一行贴底 ---------- */
.v3 .dossiers { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.v3 .dossiers--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 14px; }
.v3 .dossier { position: relative; min-width: 0; min-height: 216px; display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: 18px; background: var(--sheet); padding: 20px 22px 14px; transition: border-color .18s, transform .22s var(--ease), box-shadow .22s; animation: v3-cell-in .42s var(--ease-out) both; }
.v3 .dossiers--grid > :nth-child(2) { animation-delay: .04s; }
.v3 .dossiers--grid > :nth-child(3) { animation-delay: .08s; }
.v3 .dossiers--grid > :nth-child(4) { animation-delay: .12s; }
.v3 .dossiers--grid > :nth-child(n+5) { animation-delay: .16s; }
.v3 .dossier:hover { border-color: var(--rule-2); transform: translateY(-2px); box-shadow: var(--lift-sm); }
.v3 .dossier:focus-within, .v3 .dossier:has(details[open]) { z-index: 3; }
.v3 .dossier.is-ended { background: transparent; min-height: 0; }
.v3 .dossier.is-ended:hover { transform: none; box-shadow: none; }
.v3 .dossier.is-ended .dossier__name b { color: var(--ink-3); }
.v3 .dossier__h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.v3 .dossier__t { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
.v3 .dossier__t:hover b { color: var(--pen); }
.v3 .dossier__name { display: block; min-width: 0; }
.v3 .dossier__name b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 17px; font-weight: 650; letter-spacing: -.014em; line-height: 1.38; transition: color .16s; }
.v3 .dossier__name .sample { margin-left: 8px; vertical-align: 2px; }
.v3 .dossier.is-untitled .dossier__name b { color: var(--ink-3); }
.v3 .dossier__when { display: flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--ink-3); font-size: var(--t-meta); line-height: 1.4; }
.v3 .dossier__when svg { flex: none; color: var(--ink-4); }
.v3 .dossier__when.is-set { color: var(--ink-2); }
.v3 .dossier__when.is-set svg { color: var(--pen); }
.v3 .dossier__foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--rule); }
.v3 .dossier__foot .grow { flex: 1; }
.v3 .dossier__act { display: flex; align-items: center; gap: 12px; flex: none; }
.v3 .dossier__act form { display: inline-flex; margin: 0; }
.v3 .dossiers-more { margin-top: 14px; }
.v3 .dossiers-more > summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; color: var(--ink-3); font-size: var(--t-meta); list-style: none; }
.v3 .dossiers-more > summary::-webkit-details-marker { display: none; }
.v3 .dossiers-more > summary::before { content: "+"; font-family: var(--mono); color: var(--ink-4); }
.v3 .dossiers-more[open] > summary::before { content: "−"; }
.v3 .dossiers-more > summary:hover { color: var(--pen); }
.v3 .dossiers-more > .dossiers { margin-top: 8px; }

/* 改名：标题右边一支小铅笔，点开两格就地改（未命名的直接写着「改名」） */
.v3 .dossier__rn { position: relative; flex: none; }
.v3 .rename > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px; border-radius: 8px; color: var(--ink-4); font-size: 12px; transition: background .16s, color .16s; }
.v3 .rename > summary::-webkit-details-marker { display: none; }
.v3 .rename > summary:hover, .v3 .rename[open] > summary { color: var(--ink); background: var(--paper-2); }
.v3 .dossier.is-untitled .rename > summary { color: var(--pen); border: 1px dashed color-mix(in srgb, var(--pen) 45%, transparent); }
.v3 .rename__f { position: absolute; z-index: 20; right: 0; top: calc(100% + 6px); width: 248px; display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: var(--sheet); border: 1px solid var(--rule); box-shadow: var(--lift-sm); animation: v3-pop .18s var(--ease-out) both; transform-origin: top right; }
.v3 .rename__f input { height: 34px; padding: 0 10px; border: 1px solid var(--rule); border-radius: 9px; background: var(--paper); color: var(--ink); font: inherit; font-size: 13.5px; outline: 0; }
.v3 .rename__f input:focus { border-color: var(--pen); }
.v3 .rename__f .btn { justify-self: end; }

/* ---------- 2 轮次链：v3 五步条同一套样式，只有轮次名和状态（小字放在名字下面，半宽也放得下三四轮） ---------- */
.v3 .chain-row { display: flex; align-items: center; margin: 14px 0 14px; }
.v3 .chain-wrap { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.v3 .chain-wrap::-webkit-scrollbar { display: none; }
.v3 .chain { flex: none; width: 100%; min-width: max-content; padding: 2px 0; }
.v3 .chain .stage { display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 8px; font-size: 13.5px; }
.v3 .chain .stage .ix { grid-row: span 2; }
.v3 .chain .stage small { display: block; font-size: 11.5px; line-height: 1.3; }
.v3 .chain li:not(:last-child)::after { min-width: 14px; margin: 0 10px; }
.v3 .chain a.stage:hover .stage__t { color: var(--pen); }
.v3 .chain li.is-now small { color: var(--pen); font-weight: 560; }
.v3 .chain li.is-now .ix { animation: v3-now 2.4s ease-in-out infinite; }
.v3 .chain__add { flex: none; display: flex; align-items: center; }

/* ---------- 2b 新建约面：和档案框一样大的虚线框、中间一个加号；点开在原位展开成整行 ---------- */
.v3 .newbox { min-width: 0; animation: v3-cell-in .42s var(--ease-out) both; }
.v3 .newbox > summary { list-style: none; cursor: pointer; height: 100%; min-height: 216px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px; border: 1.5px dashed var(--rule-2); border-radius: 18px; color: var(--ink-3); text-align: center; transition: border-color .2s, background .2s, color .2s; }
.v3 .newbox > summary::-webkit-details-marker { display: none; }
.v3 .newbox > summary:hover, .v3 .newbox > summary:focus-visible { border-color: var(--pen); color: var(--pen); background: color-mix(in srgb, var(--pen-soft) 60%, transparent); outline: 0; }
.v3 .newbox__plus { flex: none; margin-bottom: 4px; transition: transform .38s var(--ease); }
.v3 .newbox__ring { transform-origin: 22px 22px; }
.v3 .newbox > summary:hover .newbox__plus { transform: rotate(90deg) scale(1.06); }
.v3 .newbox > summary:hover .newbox__ring { animation: v3-spin 9s linear infinite; }
.v3 .newbox > summary b { font-size: 16px; font-weight: 640; color: var(--ink); letter-spacing: -.01em; }
.v3 .newbox > summary small { font-size: var(--t-meta); color: var(--ink-4); }
.v3 .newbox__x { display: none; }
.v3 .newbox[open] { grid-column: 1 / -1; }
.v3 .newbox[open] > summary { height: auto; min-height: 0; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 14px 18px; border: 1px solid var(--rule); border-bottom: 0; border-radius: 18px 18px 0 0; background: var(--sheet); color: var(--pen); text-align: left; }
.v3 .newbox[open] .newbox__plus { width: 26px; height: 26px; margin: 0; }
.v3 .newbox[open] > summary:hover .newbox__plus { transform: none; }
.v3 .newbox[open] > summary small { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v3 .newbox[open] .newbox__x { display: grid; place-items: center; margin-left: auto; flex: none; width: 28px; height: 28px; border-radius: 8px; color: var(--ink-3); }
.v3 .newbox[open] > summary:hover .newbox__x { background: var(--paper-2); color: var(--ink); }
.v3 .newbox[open] .newbox__ring { animation: none; }
.v3 .newbox__f { display: grid; gap: 14px; padding: 2px 18px 16px; border: 1px solid var(--rule); border-top: 0; border-radius: 0 0 18px 18px; background: var(--sheet); animation: v3-unfold .3s var(--ease-out) both; }
.v3 .newbox__jd { position: relative; border: 1px solid var(--rule); border-radius: 14px; background: var(--paper); transition: border-color .16s, box-shadow .16s; }
.v3 .newbox__jd:focus-within { border-color: var(--pen); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pen) 14%, transparent); }
.v3 .newbox__jd textarea { display: block; width: 100%; min-height: 128px; max-height: 300px; resize: none; border: 0; outline: 0; background: transparent; padding: 14px 16px 48px; font: inherit; font-size: 15px; line-height: 1.65; color: var(--ink); box-shadow: none; }
.v3 .newbox__jd textarea::placeholder { color: var(--ink-4); }
.v3 .newbox__file { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; height: 30px; max-width: calc(100% - 20px); padding: 0 11px; border-radius: 8px; border: 1px dashed var(--rule-2); background: var(--sheet); color: var(--ink-3); font-size: 12.5px; cursor: pointer; transition: border-color .16s, color .16s; }
.v3 .newbox__file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v3 .newbox__file:hover, .v3 .newbox__file:focus-within { border-color: var(--pen); color: var(--pen); }
.v3 .newbox__file.is-on { border-style: solid; border-color: var(--rule); color: var(--ink); }
.v3 .newbox__file.is-bad, .v3 .rcards .rcard--up.is-bad { border-color: var(--red, #c2410c); color: var(--red, #c2410c); }
.v3 .newbox__file.is-busy, .v3 .rcards .rcard--up.is-busy { opacity: .7; cursor: progress; }
.v3 .newbox__rs { min-width: 0; margin: 0; padding: 0; border: 0; }
.v3 .newbox__rs legend { padding: 0; margin-bottom: 8px; color: var(--ink-3); font-size: var(--t-meta); }
.v3 .rcards { display: flex; flex-wrap: wrap; gap: 8px; }
.v3 .rcard { position: relative; display: inline-flex; align-items: center; gap: 10px; min-width: 176px; max-width: 100%; padding: 8px 36px 8px 8px; border: 1px solid var(--rule); border-radius: 12px; background: var(--sheet); cursor: pointer; transition: border-color .16s, background .16s, transform .16s var(--ease); }
.v3 .rcard:hover { border-color: var(--rule-2); }
.v3 .rcard:active { transform: scale(.985); }
.v3 .rcard input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.v3 .rcard__i { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--paper-2); color: var(--ink-3); }
.v3 .rcard__t { min-width: 0; display: grid; }
.v3 .rcard__t b { font-size: 13.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v3 .rcard__t small { font-size: 11.5px; color: var(--ink-4); }
.v3 .rcard__ok { position: absolute; right: 10px; top: 50%; width: 18px; height: 18px; margin-top: -9px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--rule-2); color: transparent; transition: background .16s, border-color .16s, color .16s; }
.v3 .rcard input:checked ~ .rcard__ok { background: var(--pen); border-color: var(--pen); color: var(--pen-fg); animation: v3-pop .2s var(--ease-out); }
.v3 .rcard input:checked + .rcard__i { background: var(--pen-soft); color: var(--pen); }
.v3 .rcard:has(input:checked) { border-color: var(--pen); background: color-mix(in srgb, var(--pen-soft) 55%, var(--sheet)); }
.v3 .rcard:has(input:focus-visible) { outline: 2px solid var(--pen); outline-offset: 2px; }
.v3 .rcards .rcard--up { height: auto; min-width: 0; padding: 8px 14px; gap: 6px; border: 1px dashed var(--rule-2); border-radius: 12px; background: transparent; color: var(--ink-3); font-size: var(--t-meta); font-weight: 520; }
.v3 .rcards .rcard--up:hover, .v3 .rcards .rcard--up:focus-within { border-color: var(--pen); color: var(--pen); }
.v3 .rcards .rcard--up.is-on { border-style: solid; border-color: var(--pen); background: color-mix(in srgb, var(--pen-soft) 55%, var(--sheet)); color: var(--ink); }
.v3 .newbox__bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.v3 .newbox__bar .grow { flex: 1; }
.v3 .newbox__alt { font-size: var(--t-meta); color: var(--ink-4); }
.v3 .newbox__go { height: 42px; padding: 0 16px 0 18px; border-radius: 11px; }
.v3 .newbox__rule > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-4); font-size: 12.5px; }
.v3 .newbox__rule > summary::-webkit-details-marker { display: none; }
.v3 .newbox__rule > summary:hover { color: var(--ink-2); }
.v3 .newbox__rule p { margin: 6px 0 0 19px; color: var(--ink-3); font-size: 12.5px; line-height: 1.6; }

@keyframes v3-cell-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes v3-unfold { from { opacity: 0; transform: translateY(-6px); } }
@keyframes v3-now { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--glow) 16%, transparent); } }

/* ---------- 3 「+ 加下一轮」：链末尾（chain）和岗位档案页顶部（bar）共用一张表单 ---------- */
.v3 .addnext { position: relative; display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.v3 .addnext--chain .addnext__go { appearance: none; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: var(--ink-3); }
.v3 .addnext--chain .addnext__go .ix { border-style: dashed; color: var(--ink-3); }
.v3 .addnext--chain .addnext__go:hover, .v3 .addnext--chain .addnext__go:focus-visible { color: var(--pen); }
.v3 .addnext--chain .addnext__go:hover .ix, .v3 .addnext--chain .addnext__go:focus-visible .ix { border-color: var(--pen); color: var(--pen); }
.v3 .addnext--bar .addnext__go { gap: 6px; }
.v3 .addnext__more { position: relative; }
.v3 .addnext__more > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 3px; height: 26px; padding: 0 6px; border-radius: 6px; color: var(--ink-4); font-size: 12px; white-space: nowrap; }
.v3 .addnext__more > summary::-webkit-details-marker { display: none; }
.v3 .addnext__more > summary:hover, .v3 .addnext__more[open] > summary { color: var(--ink-2); background: var(--paper-2); }
.v3 .addnext__menu { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; min-width: 132px; display: grid; padding: 6px; border-radius: 12px; background: var(--sheet); box-shadow: var(--lift-sm); border: 1px solid var(--rule); }
.v3 .addnext__menu button { appearance: none; background: none; border: 0; text-align: left; font: inherit; font-size: var(--t-ui); color: var(--ink-2); padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.v3 .addnext__menu button:hover, .v3 .addnext__menu button:focus-visible { background: var(--paper-2); color: var(--ink); }

/* ---------- 4 岗位档案页：时间线上面的加一轮、每一轮直接进入的一行 ---------- */
.v3 .addbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 4px 0 32px; padding: 14px 16px 14px 20px; border: 1px dashed var(--rule-2); border-radius: 14px; }
.v3 .addbar__t b { display: block; font-size: 15px; font-weight: 620; }
.v3 .addbar__t small { display: block; margin-top: 2px; color: var(--ink-3); font-size: var(--t-meta); }
.v3 .tl-go a.is-done b { color: var(--pen); }
.v3 .tl-go a[data-go="mock"] { color: var(--ink-3); }

/* ---------- 5 贴 JD 时认出已有岗位：没开脚本时输入框里的单选；有脚本时是从底部升起的一层（.wall 的样式在底座） ---------- */
.v3 .jd-match { margin: 0; padding: 14px 18px 12px; border: 0; border-top: 1px solid var(--rule); background: var(--pen-soft); display: grid; gap: 6px; }
.v3 .jd-match legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; font-size: var(--t-ui); font-weight: 620; color: var(--ink); line-height: 1.55; }
.v3 .jd-match label { display: flex; align-items: center; gap: 8px; font-size: var(--t-ui); color: var(--ink-2); cursor: pointer; }
.v3 .jd-match input[type="radio"] { accent-color: var(--pen); }
.v3 .jd-match__why { color: var(--ink-3); font-size: 12.5px; line-height: 1.55; }
.v3 .wall--match .wall__sheet h3 { font-size: 20px; }
.v3 .wall--match .wall__acts { flex-wrap: wrap; }
.v3 .wall--match .wall__acts .btn { white-space: normal; height: auto; min-height: 44px; padding-top: 8px; padding-bottom: 8px; line-height: 1.35; }

/* ---------- 6 手机 ---------- */
@media (max-width: 760px) {
  /* 手机一列；每格不强求等高（一列里看不出来），新建框矮一点 */
  .v3 .dossiers--grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; gap: 12px; }
  .v3 .dossier { min-height: 0; padding: 16px 16px 12px; border-radius: 16px; }
  .v3 .dossier .logo-sq { display: none; }
  .v3 .dossier__name b { font-size: 16px; }
  .v3 .chain .stage { font-size: 13px; column-gap: 7px; }
  .v3 .chain .stage small { font-size: 11px; }
  .v3 .chain li:not(:last-child)::after { min-width: 12px; margin: 0 8px; }
  .v3 .newbox > summary { min-height: 148px; border-radius: 16px; }
  .v3 .newbox[open] > summary { padding: 12px 14px; }
  .v3 .newbox[open] > summary small { display: none; }
  .v3 .newbox__f { padding: 2px 12px 14px; }
  .v3 .rcard { flex: 1 1 100%; }
  .v3 .rcards .rcard--up { flex: 1 1 100%; justify-content: center; padding: 10px 14px; }
  .v3 .newbox__bar .grow { display: none; }
  .v3 .newbox__go { flex-basis: 100%; height: 46px; order: 3; }
  .v3 .rename__f { width: min(248px, calc(100vw - 48px)); }
  .v3 .addbar { flex-direction: column; align-items: flex-start; }
  .v3 .addnext__menu { right: auto; left: 0; }
  .v3 .jd-match { padding: 12px 14px; }
  .v3 .wall--match .wall__acts { flex-direction: column-reverse; }
  .v3 .wall--match .wall__acts .btn { width: 100%; }
}

/* ---------- 7 减少动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  .v3 .dossier, .v3 .dossier__name b, .v3 .newbox, .v3 .newbox > summary, .v3 .newbox__plus, .v3 .rcard, .v3 .rcard__ok { transition: none; animation: none; }
  .v3 .dossier:hover { transform: none; }
  .v3 .newbox > summary:hover .newbox__plus { transform: none; }
  .v3 .newbox > summary:hover .newbox__ring, .v3 .chain li.is-now .ix, .v3 .newbox__f, .v3 .rename__f, .v3 .rcard input:checked ~ .rcard__ok { animation: none; }
}
