/* 项目文件（11-01 第四段，代码的可视化，docs/STYLE_PORTAL.md“项目文件”一条）：盖在编辑页的画布这一块上，同那里的白卡：
   左边树一张卡，右边一份文件或前后对比一张卡，12 圆角，彼此 12px，点阵底不画点；窄于 720px 一次看一块 */
.pf { position: absolute; inset: 0; z-index: 8; isolation: isolate; display: flex; gap: 12px; padding: 0; background: var(--cv-bg); color: var(--ink); font-size: 14px; line-height: 22px; }
.pf > .pf-side, .pf > .pf-main { animation: pf-in .22s cubic-bezier(.2, .8, .2, 1) both; }
.afe.afe-pad:not(.small) .pf { padding: 12px; }
.pf.out { animation: pf-out .16s ease-in both; pointer-events: none; }
/* 盖上来只动位移不动透明度：整块不透明，底下的画布任何时候都透不上来 */
@keyframes pf-in { from { transform: translateY(10px); } }
@keyframes pf-out { to { opacity: 0; transform: translateY(6px); } }
@keyframes pf-spin { to { transform: rotate(360deg); } }
.pf-i { width: 18px; height: 18px; fill: currentColor; flex: none; }

.pf-side, .pf-main { display: flex; flex-direction: column; min-height: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-sm); overflow: hidden; }
.pf-side { flex: none; width: 280px; }
.pf-main { flex: 1; min-width: 0; }
.pf-sh, .pf-mh { flex: none; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--divider); }
.pf-st { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; }
.pf-x, .pf-back { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--r);
  background: none; color: var(--ink3); cursor: pointer; transition: background-color .15s, color .15s; }
.pf-x:hover, .pf-back:hover { background: var(--hover2); color: var(--ink); }
/* 文件页签头上“上传”（11-02 FIX1 A3）：小号描边键，28px 高，同右卡头上“去 Know-how 页编辑”的样子；传的时候淡下来 */
.pf-up { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px 0 8px; border: 1px solid var(--border); border-radius: var(--r);
  background: var(--card); color: var(--ink2); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: background-color .15s, color .15s; }
.pf-up[hidden] { display: none; }
.pf-up .pf-i { width: 16px; height: 16px; color: var(--ink3); }
.pf-up:hover { background: var(--hover); color: var(--ink); }
.pf-up:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--focus-ring); }
.pf-up.busy { opacity: .55; cursor: progress; }
.pf-x:focus-visible, .pf-back:focus-visible, .pf-row:focus-visible, .pf-gap:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--focus-ring); }
.pf-sb { flex: 1; min-height: 0; overflow: auto; padding: 6px 0 16px; scrollbar-width: thin;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 14px), transparent 100%); mask-image: linear-gradient(to bottom, #000 calc(100% - 14px), transparent 100%); }

/* 树：一行 30px，一层缩进 16px，文件夹带三角，收起的三角朝右 */
.pf-row { display: flex; align-items: center; gap: 6px; width: 100%; height: 30px; padding: 0 12px 0 10px; border: 0; background: none; color: var(--ink2); font: inherit; font-size: 13px;
  text-align: left; cursor: pointer; transition: background-color .12s, color .12s; }
/* 悬停只在有鼠标的设备上（手机上点过的那一行不留着灰底） */
@media (hover: hover) { .pf-row:hover { background: var(--hover); color: var(--ink); } }
.pf-row.on { background: var(--primary-bg); color: var(--primary); }
/* 看一句的改动时，选中的那一行用中性灰底，名字照改法上色，不跟“改了”的主色混在一起（11-02 E2，Gemini） */
.pf-row.on.chg, .pf-row.on.chg:hover { background: var(--hover2); }
.pf-row.on.chg .pf-fi { color: var(--ink3); }
.pf-row.dir.empty { cursor: default; }
.pf-row.lock { color: var(--ink4); cursor: default; }
.pf-row.lock:hover { background: none; color: var(--ink4); }
.pf-row .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-row.dir { color: var(--ink); font-weight: 500; }
.pf-caret { width: 16px; height: 16px; color: var(--ink4); transition: transform .16s; }
.pf-caret.open { transform: rotate(90deg); }
.pf-caret-sp { flex: none; width: 16px; }
.pf-fi { width: 16px; height: 16px; color: var(--ink4); }
.pf-fi.dir { color: var(--ink3); }
.pf-row.on .pf-fi { color: var(--primary); }
.pf-none { padding: 20px 16px; color: var(--ink3); font-size: 13px; }
.pf-spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: pf-spin .8s linear infinite; vertical-align: middle; }

/* 看一句的改动：改过的文件名照改法上色，右边新加，改了，删了的小标签；删掉的划掉；里面有改动的文件夹右边一个小点 */
.pf-row.chg.added .t { color: var(--success-ink); }
.pf-row.chg.modified .t { color: var(--primary); }
.pf-row.chg.deleted .t { color: var(--red-ink); text-decoration: line-through; }
.pf-row.chg .pf-chip { margin-left: auto; }
.pf-dot { flex: none; width: 6px; height: 6px; margin: 0 4px 0 auto; border-radius: 50%; background: var(--primary); }
.pf-chip { flex: none; display: inline-block; height: 18px; padding: 0 5px; border-radius: var(--r-sm); font-size: 11.5px; font-weight: 500; line-height: 18px; }
.pf-chip.added { color: var(--success-ink); background: var(--success-bg); }
.pf-chip.modified { color: var(--primary); background: var(--primary-bg); }
.pf-chip.deleted { color: var(--red-ink); background: var(--red-bg); }
.pf-n { flex: none; display: inline-flex; gap: 6px; font: 12px/18px var(--mono); }
.pf-n .a { color: var(--success-ink); }
.pf-n .d { color: var(--red-ink); }

/* 右边：头上文件名与更新时刻（对比时是小标签与加删几行），下面全文或对比 */
.pf-mh { padding: 0 16px 0 16px; }
.pf-path { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.pf-pathname { display: flex; align-items: baseline; min-width: 0; overflow: hidden; white-space: nowrap; }
/* 文件夹放不下时从前面省略，留下挨着文件名的那一段：“…walk_dedupe/impl.py” */
.pf-pathname .pf-dir { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; direction: rtl; color: var(--ink4); font-weight: 400; }
.pf-pathname .pf-nm { flex: 0 0 auto; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pf-pn { font-size: 14px; font-weight: 600; }
.pf-pn .pf-dir { color: var(--ink3); }
.pf-row.on .pf-pathname .pf-dir { color: inherit; opacity: .72; }
.pf-meta { flex: none; display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink3); white-space: nowrap; }
/* 对比与全文：浅灰底轨道，选中的一块白底浮起（同结果页签里“表格，数据”的样子） */
.pf-seg { display: inline-flex; padding: 2px; border-radius: var(--r); background: var(--grey-bg); }
.pf-seg button { height: 24px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--ink3); font: inherit; font-size: 12.5px; cursor: pointer; }
.pf-seg button:hover { color: var(--ink); }
.pf-seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--sh-xs); font-weight: 500; }
.pf-seg button:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--focus-ring); }
.pf-back { display: none; margin-left: -8px; }
.pf-mb { flex: 1; min-height: 0; overflow: auto; position: relative; display: flex; flex-direction: column; scrollbar-width: thin; }
.pf-code { flex: 1; min-height: 0; display: flex; background: var(--code, var(--card)); }
.pf-code > .cm-editor { flex: 1; min-width: 0; height: 100%; }
.pf-code .cm-scroller { overflow: auto; scrollbar-width: thin; }
/* 这里只读：不摆当前行的底色（那是能改的编辑器的样子） */
.pf-code .cm-activeLine, .pf-code .cm-activeLineGutter { background: transparent; color: inherit; }
.pf-pre { margin: 0; padding: 12px 16px; font: 12.5px/20px var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }

/* 对比：两列行号，加的绿底，删的红底，没变的长段收成一行虚线框，点开看 */
.pf-diff { padding: 8px 0 24px; font: 12.5px/20px var(--mono); color: var(--ink); }
.pf-dr { display: flex; min-height: 20px; }
.pf-dr .no { flex: none; width: 44px; padding-right: 8px; text-align: right; color: var(--ink4); user-select: none; -webkit-user-select: none; }
.pf-dr .sg { flex: none; width: 18px; text-align: center; color: var(--ink4); user-select: none; -webkit-user-select: none; }
.pf-dr .tx { flex: 1; min-width: 0; padding: 0 16px 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; }
.pf-dr.add { background: var(--success-bg); }
.pf-dr.add .sg { color: var(--success-ink); font-weight: 600; }
.pf-dr.del { background: var(--red-bg); }
.pf-dr.del .sg { color: var(--red); font-weight: 600; }
.pf-gap { display: flex; align-items: center; gap: 6px; width: 100%; height: 28px; margin: 2px 0; padding: 0 0 0 114px; border: 0; border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border); background: var(--card); color: var(--ink3); font: 12px/28px var(--mono); cursor: pointer; text-align: left; }
.pf-gap .pf-i { width: 16px; height: 16px; }
.pf-gap:hover { color: var(--primary); background: var(--primary-bg); }

/* 窄的时候一次看一块：树占满，点了一份看它，头上带返回 */
.pf.one .pf-side { flex: 1; width: auto; }
.pf.one .pf-back { display: inline-flex; }
.pf.one[data-pane="tree"] .pf-main { display: none; }
.pf.one[data-pane="view"] .pf-side { display: none; }
.pf.one .pf-dr .no { width: 34px; padding-right: 6px; }
.pf.one .pf-gap { padding-left: 92px; }
.pf.one .pf-time { display: none; }

/* 左卡头上两个页签“文件”“活动”（11-01 原生对齐 N3）：同页面页签的写法，灰字，当前一项正文色加粗，下面 2px 正文色的线 */
.pf-tabs { flex: 1; min-width: 0; display: flex; align-self: stretch; gap: 4px; margin-left: -8px; }
.pf-tab { position: relative; height: 100%; padding: 0 10px; border: 0; background: none; color: var(--ink3); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.pf-tab:hover { color: var(--ink); }
.pf-tab.on { color: var(--ink); font-weight: 600; }
.pf-tab.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ink); }
.pf-tab:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px var(--focus-ring); border-radius: 6px; }
.pf-si { width: 14px; height: 14px; color: var(--ink4); }
.pf-spin.sm { width: 12px; height: 12px; border-width: 2px; }

/* 活动清单：一天一组，一句一块，几时谁说的，说了什么（两行），各种事做了几步与存成第几版 */
.pf-acts { display: flex; flex-direction: column; padding: 0 6px; }
.pf-day { padding: 12px 8px 4px; color: var(--ink4); font-size: 12px; font-weight: 500; line-height: 16px; }
.pf-day:first-child { padding-top: 6px; }
.pf-ai { display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--r); background: none; color: var(--ink2);
  font: inherit; text-align: left; cursor: pointer; transition: background-color .12s; }
div.pf-ai { cursor: default; }
button.pf-ai:hover { background: var(--hover); }
.pf-ai.on { background: var(--primary-bg); }
.pf-ai:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--focus-ring); }
.pf-ai .r1 { display: flex; align-items: center; gap: 8px; min-width: 0; height: 18px; color: var(--ink3); font-size: 12px; line-height: 18px; }
.pf-ai .r1 .tm { flex: none; font-variant-numeric: tabular-nums; }
.pf-ai .r1 .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-ai .r1 .pf-v { margin-left: auto; flex: none; color: var(--ink3); }
.pf-ai .r1 .pf-v.off { color: var(--ink4); text-decoration: line-through; }
.pf-ai .r1 .pf-v + .pf-st2 { margin-left: 0; }
.pf-ai .r1 .pf-st2 { margin-left: auto; }
.pf-ai .r2 { color: var(--ink); font-size: 13px; line-height: 19px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.pf-ai .r2 .seg { display: inline-flex; align-items: center; gap: 4px; color: var(--ink3); }
.pf-ai.ask .r2 { color: var(--ink3); font-size: 12.5px; -webkit-line-clamp: 1; }
.pf-ai .r3 { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; color: var(--ink3); font: 12px/18px var(--mono); }
.pf-tl { display: inline-flex; align-items: center; gap: 3px; }
.pf-tl .pf-tli { width: 13px; height: 13px; color: var(--ink4); }
.pf-tl.v { font-family: inherit; }
.pf-tl.v.off { color: var(--ink4); text-decoration: line-through; }
.pf-ai.on .r3, .pf-ai.on .r1 { color: var(--ink2); }
.pf-st2 { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 6px; border-radius: var(--r-sm); font-size: 11.5px; font-weight: 500; line-height: 18px; }
.pf-st2.warn { color: var(--orange-ink); background: var(--orange-bg); }
.pf-st2.err { color: var(--red-ink); background: var(--red-bg); }
.pf-st2.plain { color: var(--ink3); background: var(--grey-bg); }
.pf-st2.run { color: var(--sky-ink); background: var(--sky-bg); }
.pf-older { display: flex; align-items: center; justify-content: center; gap: 6px; height: 32px; margin: 8px 4px 4px; border: 1px dashed var(--border); border-radius: var(--r);
  background: none; color: var(--ink3); font: inherit; font-size: 12.5px; cursor: pointer; }
.pf-older:hover { color: var(--primary); border-color: var(--primary); }

/* 右卡看一句：头上谁与几时，下面说的话，答复（长的先收着），计划，做了哪几步，改的文件，撤回 */
.pf-th { display: inline-flex; align-items: baseline; gap: 8px; color: var(--ink3); }
.pf-th b { color: var(--ink); font-size: 14px; font-weight: 600; }
.pf-tb { width: 28px; height: 28px; margin-left: -8px; }
.pf-td { display: flex; flex-direction: column; gap: 8px; padding: 16px 20px 28px; max-width: 880px; }
.pf-tq { align-self: flex-start; max-width: 100%; padding: 8px 12px; border-radius: 14px; background: var(--grey-bg); color: var(--ink); font-size: 13.5px; line-height: 21px;
  white-space: pre-wrap; overflow-wrap: anywhere; }
.pf-tq.seg { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: none; border: 1px solid var(--border); color: var(--ink3); font-size: 12.5px; }
/* 这一句带上的文件（R2c P2-5）：说的话下面一行浅蓝小块，同对话里那一句与输入框上面那一行 */
.pf-ufs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -2px; }
.pf-ufs + .pf-ta, .pf-ufs + .pf-sec { margin-top: 8px; }         /* 带的文件跟着说的话，答复另起，不贴在一起（Gemini） */
.pf-ufile { display: inline-flex; align-items: center; gap: 4px; max-width: 240px; height: 24px; padding: 0 8px; border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent);
  border-radius: var(--r-sm); background: var(--primary-bg); color: var(--primary); font: inherit; font-size: 12px; cursor: pointer; transition: border-color .12s ease; }
.pf-ufile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-ufile .pf-ufi { flex: none; width: 14px; height: 14px; }
.pf-ufile:hover { border-color: var(--primary); }
.pf-ufile:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--focus-ring); }
.pf-ufile.lock { border-color: var(--border); background: var(--grey-bg); color: var(--ink4); cursor: default; }
.pf-ta { color: var(--ink2); font-size: 13.5px; line-height: 22px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: none; }
.pf-ta.cut { max-height: 264px; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent); }
.pf-ta.err { color: var(--red-ink); }
.pf-more { align-self: flex-start; height: 24px; margin-top: -4px; padding: 0 8px; margin-left: -8px; border: 0; border-radius: 6px; background: none; color: var(--primary); font: inherit; font-size: 12.5px; cursor: pointer; }
.pf-more:hover { background: var(--primary-bg); }
.pf-sec { margin-top: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--divider); color: var(--ink); font-size: 13px; font-weight: 600; line-height: 18px; }
.pf-plan { margin-top: 2px; }
.pf-td > .act-l { margin-top: 0; }
.pf-tf { display: flex; flex-direction: column; gap: 1px; }
.pf-tf .pf-row { height: 28px; padding: 0 8px; border-radius: 6px; }
.pf-tf .pf-row .t { flex: 1; }
.pf-tf .pf-row .pf-n { margin-left: auto; }
.pf-tacts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; font-size: 13px; }
.pf-tacts > div { display: flex; flex-direction: column; gap: 6px; }
.pf-ver { color: var(--ink3); }
.pf.one .pf-td { padding: 12px 14px 24px; }
