/* 骗术档案页。沿用信境暖纸 / 炭黑 / 警示黄 / 陶土 / 橄榄色板；无渐变、无蓝色。
   2026-10-31 内容区精修：筛选条改为两栏网格、档案卡加编号与等高节奏、阅读进度单独成行。 */
:root {
  --p-paper: var(--bg-0, #fdfcf3);
  --p-white: var(--panel, #ffffff);
  --p-ink: var(--ink, #22211e);
  --p-muted: var(--muted, #655f56);
  --p-line: var(--line, #d5d1c8);
  --p-yellow: var(--yellow, #edc84c);
  --p-olive: var(--olive, #516645);
  --p-clay: var(--clay, #a65336);
  --p-radius: var(--radius-lg, 6px);
}

/* 页面只在本页兜底 sr-only；此前依赖的通用工具类没有随页面加载。 */
.profiles-page .sr-only,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.profiles-page {
  padding-top: clamp(22px, 3.4vw, 38px);
  padding-bottom: 64px;
}

/* ---- 首屏：保留档案语气，压缩到一屏内看到筛选条 ---- */
.profiles-hero { max-width: 940px; padding-bottom: 22px; border-bottom: 1px solid var(--p-line); }
.profiles-hero .eyebrow { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .16em; color: var(--p-olive); }
.profiles-hero h1 { margin: 10px 0 12px; font-size: clamp(31px, 4.4vw, 46px); line-height: 1.18; letter-spacing: -.01em; font-weight: 800; }
.profiles-lede { max-width: 66ch; margin: 0 0 16px; color: var(--p-muted); font-size: 15px; line-height: 1.85; }
.profiles-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.profiles-stats > div { background: var(--p-white); border: 1px solid var(--p-line); border-left: 3px solid var(--p-yellow); border-radius: var(--radius-md); padding: 8px 14px; min-width: 110px; }
.profiles-stats dt { margin: 0; font-size: 11px; letter-spacing: .12em; color: var(--p-muted); }
.profiles-stats dd { margin: 2px 0 0; font-size: 18px; font-weight: 800; line-height: 1.35; }
.profiles-note { max-width: 82ch; margin: 0; padding: 9px 14px; border-left: 3px solid var(--p-yellow); background: var(--p-white); color: var(--p-muted); font-size: 12.5px; line-height: 1.75; }

/* ---- 筛选条：上排搜索 + 随机，下排分类 + 计数，进度独占一行 ---- */
.profiles-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "search random"
    "chips  count"
    "progress progress";
  align-items: center;
  gap: 12px 16px;
  margin: 20px 0 14px;
  padding: 16px;
  border: 1px solid var(--p-line);
  border-top: 2px solid var(--p-ink);
  border-radius: var(--p-radius);
  background: var(--p-white);
}
.profiles-search { grid-area: search; min-width: 0; }
.profiles-search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--p-line);
  border-radius: var(--radius-md);
  background: var(--p-paper);
  color: var(--p-ink);
  font: inherit;
  font-size: 14px;
}
.profiles-search input::placeholder { color: var(--p-muted); opacity: .9; }
.profiles-search input:focus-visible { outline: 3px solid var(--p-clay); outline-offset: 2px; }
.profiles-chips { grid-area: chips; display: flex; flex-wrap: wrap; gap: 8px; }
.profiles-chip {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--p-line);
  border-radius: var(--radius-pill);
  background: var(--p-paper);
  color: var(--p-ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.profiles-chip:hover { border-color: var(--p-ink); }
.profiles-chip[aria-checked="true"],
.profiles-chip[aria-pressed="true"] {
  background: var(--p-ink);
  border-color: var(--p-ink);
  color: var(--p-paper);
  font-weight: 700;
}
.profiles-chip:focus-visible,
.profiles-random:focus-visible { outline: 3px solid var(--p-clay); outline-offset: 2px; }
.profiles-random {
  grid-area: random;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--p-ink);
  border-radius: var(--radius-pill);
  background: var(--p-yellow);
  color: var(--p-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.profiles-random:hover { background: var(--p-ink); color: var(--p-paper); }
.profiles-count { grid-area: count; margin: 0; color: var(--p-muted); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }

.profiles-progress-row {
  grid-area: progress;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px dashed var(--p-line);
}
.profiles-progress-label {
  flex: none;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--p-clay);
}
.profiles-progress { flex: 1 1 260px; min-width: 0; margin: 0; color: var(--p-ink); font-size: 13px; line-height: 1.7; font-variant-numeric: tabular-nums; }

/* ---- 档案卡：三列等高，编号 + 分类在顶，破绽摘要居中，动作贴底 ---- */
.profiles-grid {
  counter-reset: profile;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.profile-card {
  position: relative;
  display: flex;
  min-width: 0;
  background: var(--p-white);
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius);
  counter-increment: profile;
}
.profile-card::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: var(--radius-sm); background: var(--cat, var(--p-olive)); }
.profile-card__btn {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-height: 100%;
  padding: 20px 20px 16px 24px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--p-radius);
}
.profile-card__btn:hover { background: var(--p-paper); }
.profile-card__btn:focus-visible { outline: 3px solid var(--p-clay); outline-offset: 3px; }
.profile-card--impersonation { --cat: var(--p-clay); }
.profile-card--incentive { --cat: var(--p-olive); }
.profile-card--transaction { --cat: #8a5a12; }
.profile-card--relationship { --cat: #7a4a2b; }
.profile-card--tech { --cat: #3f4a3a; }
.profile-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px 10px; font-size: 11.5px; color: var(--p-muted); }
.profile-cat { color: var(--cat, var(--p-olive)); font-weight: 800; letter-spacing: .06em; }
.profile-cat::before { content: counter(profile, decimal-leading-zero) " / "; color: var(--p-muted); font-weight: 700; letter-spacing: .08em; }
.profile-name { font-size: 24px; line-height: 1.3; font-weight: 800; letter-spacing: -.01em; color: var(--p-ink); }
.profile-alias { color: var(--p-muted); font-size: 12.5px; }
.profile-hook { margin: 2px 0; font-size: 14.5px; line-height: 1.7; color: var(--p-ink); }
.profile-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.profile-tag { padding: 2px 9px; border: 1px solid var(--p-line); border-radius: var(--radius-pill); background: var(--p-paper); font-size: 12px; color: var(--p-muted); }
.profile-open-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--p-line);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--p-ink);
}
.profile-open-hint > span { color: var(--p-clay); font-size: 14px; }
.profiles-empty { margin: 22px 0; padding: 22px; border: 1px dashed var(--p-line); border-radius: var(--p-radius); color: var(--p-muted); text-align: center; }
.profiles-hint { margin: 0 0 18px; color: var(--p-muted); font-size: 13px; line-height: 1.7; }

/* ---- 阅读/识破状态 ---- */
.profile-state-wrap { display: inline-flex; align-items: center; gap: 8px; }
.profile-state {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border: 1px solid var(--p-yellow);
  border-radius: var(--radius-pill);
  background: #f8efcf;
  color: var(--p-ink);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.profile-state--solved { border-color: var(--p-olive); background: var(--p-olive); color: var(--p-white); }

/* ---- 档案怎么用 / 内容边界 ---- */
.profiles-howto { margin-top: 34px; padding: 22px 24px; border: 1px solid var(--p-line); border-radius: var(--p-radius); background: var(--p-white); }
.profiles-howto h2 { margin: 0 0 14px; font-size: 21px; }
.profiles-howto ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 0 0 14px; padding: 0; list-style: none; counter-reset: howto; }
.profiles-howto li { position: relative; padding-left: 34px; color: var(--p-muted); font-size: 13.5px; line-height: 1.8; }
.profiles-howto li::before { counter-increment: howto; content: counter(howto, decimal-leading-zero); position: absolute; left: 0; top: 1px; color: var(--p-clay); font-weight: 800; font-size: 13px; }
.profiles-howto li b { color: var(--p-ink); }
.profiles-howto p { margin: 0; font-size: 13.5px; line-height: 1.85; color: var(--p-muted); }
.profiles-howto a { display: inline-flex; align-items: center; min-height: 44px; margin-right: 6px; color: var(--p-ink); font-weight: 700; text-underline-offset: 3px; }

.profiles-boundary { margin-top: 18px; padding: 20px 24px; border: 1px solid var(--p-line); border-left: 4px solid var(--p-yellow); background: var(--p-white); border-radius: 0 var(--p-radius) var(--p-radius) 0; }
.profiles-boundary h2 { margin: 0 0 8px; font-size: 18px; }
.profiles-boundary ul { margin: 0; padding-left: 18px; color: var(--p-muted); font-size: 13.5px; line-height: 1.85; }
.profiles-boundary li + li { margin-top: 4px; }
.profiles-boundary b { color: var(--p-ink); }

/* ---- 详情弹窗 ---- */
.profile-dialog { width: min(860px, 94vw); max-height: 88vh; padding: 0; border: 1px solid var(--p-ink); border-radius: var(--radius-xl); background: var(--p-paper); color: var(--p-ink); overflow: hidden; }
.profile-dialog::backdrop { background: rgba(25, 24, 21, .46); }
.profile-dialog__panel { display: flex; flex-direction: column; max-height: 88vh; }
.profile-dialog__bar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--p-line); background: var(--p-white); }
.profiles-kicker { font-size: 11px; font-weight: 800; letter-spacing: .16em; color: var(--p-olive); }
.profile-dialog__close { min-height: 44px; padding: 8px 16px; border: 1px solid var(--p-ink); border-radius: var(--radius-md); background: transparent; color: var(--p-ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.profile-dialog__close:hover { background: var(--p-yellow); }
.profile-dialog__close:focus-visible { outline: 3px solid var(--p-clay); outline-offset: 2px; }
.profile-dialog__body { overflow-y: auto; padding: 22px 24px 26px; }
.pd-meta { margin: 0; color: var(--p-olive); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.pd-title { margin: 6px 0 2px; font-size: clamp(28px, 4vw, 38px); line-height: 1.2; }
.pd-alias { margin: 0 0 10px; color: var(--p-muted); font-size: 13px; }
.pd-hook { margin: 0 0 18px; padding: 12px 16px; border-left: 3px solid var(--p-clay); background: var(--p-white); font-size: 17px; line-height: 1.6; }
.pd-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pd-section { border: 1px solid var(--p-line); border-radius: var(--radius-md); background: var(--p-white); padding: 14px 16px; }
.pd-section--wide { grid-column: 1 / -1; }
.pd-section h3 { margin: 0 0 8px; font-size: 15px; letter-spacing: .02em; }
.pd-section p { margin: 0; color: var(--p-muted); font-size: 13.5px; line-height: 1.75; }
.pd-targets { margin-top: 8px !important; font-size: 12.5px !important; }
.pd-list { margin: 0; padding: 0; list-style: none; }
.pd-list li { padding: 8px 0; border-top: 1px solid var(--p-line); color: var(--p-muted); font-size: 13.5px; line-height: 1.7; }
.pd-list li:first-child { border-top: 0; padding-top: 0; }
.pd-list li b { display: block; color: var(--p-ink); font-size: 13.5px; }
.pd-list li span { display: block; margin-top: 2px; }
.pd-boundary { margin: 16px 0 0; color: var(--p-muted); font-size: 12.5px; line-height: 1.7; }
.pd-practice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--p-line); font-size: 13px; color: var(--p-muted); }
.pd-practice__link { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 1px solid var(--p-ink); border-radius: var(--radius-md); color: var(--p-ink); font-weight: 700; text-decoration: none; }
.pd-practice__link:hover { background: var(--p-yellow); }
.pd-practice__link:focus-visible { outline: 3px solid var(--p-clay); outline-offset: 2px; }
.profiles-noscript { margin-top: 20px; padding: 16px; border: 1px solid var(--p-line); background: var(--p-white); font-size: 14px; }

/* ---- 先猜一下 ---- */
.pd-quiz { margin: 0 0 18px; padding: 16px; border: 1px solid var(--p-line); border-left: 4px solid var(--p-yellow); border-radius: var(--radius-md); background: var(--p-white); }
.pd-quiz h3 { margin: 0 0 6px; font-size: 15px; }
.pd-quiz__q { margin: 0 0 12px; font-size: 15px; line-height: 1.65; font-weight: 700; }
.pd-quiz__options { display: grid; gap: 8px; }
.pd-quiz__option { width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--p-line); border-radius: var(--radius-md); background: var(--p-paper); color: var(--p-ink); font: inherit; font-size: 13.5px; line-height: 1.6; text-align: left; cursor: pointer; }
.pd-quiz__option:hover:not(:disabled) { border-color: var(--p-ink); background: var(--p-yellow); }
.pd-quiz__option:focus-visible { outline: 3px solid var(--p-clay); outline-offset: 2px; }
.pd-quiz__option.is-correct { border-color: var(--p-olive); background: #eaf0df; font-weight: 700; }
.pd-quiz__option.is-wrong { border-color: var(--p-clay); background: #f6e5da; }
.pd-quiz__option:disabled { cursor: default; opacity: 1; }
.pd-quiz__feedback { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--radius-md); background: var(--p-paper); color: var(--p-muted); font-size: 13px; line-height: 1.7; }
.pd-quiz__feedback.is-correct { background: #eaf0df; color: var(--p-ink); }
.pd-quiz__feedback.is-wrong { background: #f6e5da; color: var(--p-ink); }
.pd-quiz__feedback:focus-visible { outline: 3px solid var(--p-clay); outline-offset: 2px; }

/* ---- 弹窗工具条 ---- */
.profile-dialog__bar { flex-wrap: wrap; gap: 8px; }
.profile-dialog__tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.profile-dialog__tool { min-height: 44px; padding: 6px 12px; border: 1px solid var(--p-line); border-radius: var(--radius-md); background: transparent; color: var(--p-ink); font: inherit; font-size: 12.5px; cursor: pointer; }
.profile-dialog__tool:hover:not(:disabled) { background: var(--p-yellow); border-color: var(--p-ink); }
.profile-dialog__tool:focus-visible { outline: 3px solid var(--p-clay); outline-offset: 2px; }
.profile-dialog__tool:disabled { opacity: .45; cursor: default; }
.profile-dialog__note { margin: 0; padding: 8px 20px; border-bottom: 1px solid var(--p-line); background: #eaf0df; color: var(--p-ink); font-size: 12.5px; }

@media (max-width: 1020px) {
  .profiles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profiles-howto ol { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 680px) {
  .profiles-page { padding-top: 22px; }
  .profiles-grid { grid-template-columns: 1fr; gap: 14px; }
  .profiles-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .profiles-stats > div { min-width: 0; padding: 8px 12px; }
  .profiles-stats > div:nth-child(3) { grid-column: 1 / -1; }
  .profiles-controls {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "search"
      "chips"
      "random"
      "count"
      "progress";
    gap: 10px;
    padding: 14px;
  }
  .profiles-random { justify-self: start; }
  .profiles-count { text-align: left; }
  .profiles-progress { flex-basis: 100%; }
  .pd-sections { grid-template-columns: 1fr; }
  .profile-dialog { width: 96vw; max-height: 92vh; }
  .profile-dialog__body { padding: 18px 16px 22px; }
  .profiles-howto { padding: 18px 16px; }
  .profiles-boundary { padding: 16px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .profile-card__btn, .profile-dialog, .profiles-chip, .profiles-random { transition: none; }
}
