/* ===== 角色档案页 ===== */
/* 设计与理由见 PROMPT/09_角色档案页.md
 * 本文件禁止出现 backdrop-filter 和 will-change，滑入只动 transform。
 * 颜色一律取 base.css 已有变量：卡片统一 --c-bg，容器 --c-surface-2，按压 --c-surface-3。
 * 弹窗骨架（.api-modal / .api-model）、分段卡槽（.api-tabs）、输入框（.api-field-box /
 * .api-input / .api-eye）全部复用 css/setting-api.css，这里只写差异。 */
.pf-page,
.pf-detail {
  /* 这一组是 setting-api.css 里 .api-modal / .api-model / .api-btn / .api-field-box
   * 读的变量，值必须与 .api-page 保持一致，否则复用过来的弹窗会塌成没圆角、没底色的一坨 */
  --card-radius: 20px;
  --card-radius-in: 5px;
  --card-gap: 2px;
  --card-bg: var(--c-surface-2);
  --press-bg: var(--c-surface-3);
  --field-h: 48px;
  --btn-h: 46px;

  /* 本页自己的卡片底色，另起一个名字，不去顶掉上面那组 */
  --pf-card-bg: var(--c-bg);     /* 精选卡与普通角色卡的唯一底色，不做深浅两套 */

  /* 字号 / 字重不在这里定义：统一走 base.css :root 的 --title-* / --label-* / --row-* */

  position: absolute;            /* #app 是 position: relative，见 base.css */
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--c-surface);  /* 必须不透明，完整盖住后面的页面 */

  transform: translateX(100%);
  visibility: hidden;
  transition:
    transform 0.3s var(--ease),
    visibility 0s linear 0.3s;
}

.pf-page.show,
.pf-detail.show {
  transform: translateX(0);
  visibility: visible;
  transition:
    transform 0.3s var(--ease),
    visibility 0s;
}

.pf-page { z-index: 10; }        /* 与设置页同级，两者不会同时打开 */
.pf-detail { z-index: 11; }      /* 二级页：盖住列表页，低于 .ap-modal 的 12 */

/* hidden 属性来自 UA 样式表，本文件里的 display 声明会盖掉它，补一条更高优先级的 */
.pf-page [hidden],
.pf-detail [hidden] { display: none; }

/* ===== 列表页滚动区 ===== */
.pf-scroll {
  flex: 1;                       /* .scroll-area 不带 flex: 1 */
  min-height: 0;
  overflow-x: hidden;            /* 精选卡用负边距顶到屏幕边，这里兜住任何横向溢出 */
  /* 安全区一律用加法，不能用 max() */
  padding: calc(12px + var(--sat)) 20px calc(32px + var(--sab));
}

/* 视觉尺寸沿用设置页的 40px，靶区用伪元素补到 44px。
 * 不要直接把这些按钮改成 44px —— 那会和设置页 / API 页的顶栏对不齐 */
.pf-back,
.pf-round,
.pf-done,
.pf-tab {
  position: relative;
}
.pf-back::after,
.pf-round::after,
.pf-done::after,
.pf-tab::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 44px;
  transform: translate(-50%, -50%);
}
.pf-back::after,
.pf-round::after { width: 44px; }

/* ===== 返回键：与设置页同参数 ===== */
.pf-back {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--c-surface-2);
  color: var(--c-text);          /* reicon 内部用 currentColor */
  transition: transform 0.15s var(--ease), background var(--dur) var(--ease);
}
.pf-back:active {
  transform: scale(0.88);
  background: var(--press-bg);
}

/* ===== 顶栏：返回键 + 左对齐标题 + 右两个圆钮，同一行 ===== */
.pf-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 标题占满中间的剩余宽度并左对齐 —— 不要改成居中 */
.pf-heading {
  flex: 1;
  min-width: 0;
}

.pf-eyebrow {
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-hint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pf-title {
  margin: 6px 0 0;
  font-size: var(--title-size);
  font-weight: var(--title-weight);
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: var(--c-text);          /* 主文字用深灰，不用纯黑 */
}

.pf-head-btns {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 320 宽的机器上「CHARACTERS PROFILE」和三个圆钮同排会差几个像素，
 * 只在这一档收字距，375 及以上仍与设置页逐值一致 */
@media (max-width: 360px) {
  .pf-eyebrow { letter-spacing: 0.12em; }
}

/* 底色与设置页返回键同一档：白底 + 阴影在 --c-surface 页面上太跳。
 * 尺寸也与返回键一致的 40px，靶区由下面的伪元素补到 44px ——
 * 三个圆钮加标题要在 320px 宽里一行放得下 */
.pf-round {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--c-surface-2);
  color: var(--c-text);
  transition: transform 0.15s var(--ease), background var(--dur) var(--ease);
}
.pf-round:active {
  transform: scale(0.9);
  background: var(--press-bg);
}

/* ===== 可折叠搜索行 ===== */
/* 页面流内的折叠项，不是覆盖层：收起时高度真的是 0，不占位。
 * 折叠只能动高度，这里配合 opacity 一起过渡，时长走全局 --dur */
.pf-search {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.pf-search.is-open {
  max-height: 76px;
  opacity: 1;
}

.pf-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  margin-top: 16px;
  padding: 0 18px;
  border-radius: 24px;
  background: var(--c-surface-2);
  color: var(--c-hint);          /* 放大镜图标颜色 */
}

.pf-search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  /* 必须 >= 16px，否则 iOS 一聚焦就把整页放大 */
  font-size: 16px;
  color: var(--c-text);
  -webkit-appearance: none;
  appearance: none;
}
.pf-search-box input::placeholder { color: var(--c-hint); }
/* 去掉 Safari 给 type="search" 附加的原生装饰与清除按钮 */
.pf-search-box input::-webkit-search-decoration,
.pf-search-box input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* ===== 加号菜单 ===== */
/* 与 .pf-scroll 平级，位置由 JS 按按钮实际坐标算：按钮会跟着页面滚 */
.pf-menu-scrim {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: none;              /* 只用来接住「点菜单外」，不做视觉遮罩 */
}

/* 模糊底层内容防止文字重叠；top 由 JS 定在顶栏底部，顶栏不模糊 */
.pf-menu-blur {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  pointer-events: none;          /* 点击穿给 scrim */
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.16s var(--ease);
}
.pf-menu-blur.show { opacity: 1; }

.pf-menu {
  position: absolute;
  z-index: 5;
  min-width: 152px;
  opacity: 0;
  transform: scale(0.94);
  transform-origin: top right;
  transition: opacity 0.16s var(--ease), transform 0.16s var(--ease);
}
.pf-menu.show {
  opacity: 1;
  transform: scale(1);
}

/* 每行：文字在左、40px 圆形图标钮在右，整体靠右对齐，圆钮正对顶栏加号 */
.pf-menu-item {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  width: 100%;
  padding: 0;                    /* button 行不清掉默认内边距会和 div 行错位 */
  text-align: right;
  font-size: var(--row-name-size);
  font-weight: var(--row-name-weight);
  color: var(--c-text);
}
.pf-menu-item + .pf-menu-item { margin-top: 14px; }

/* 与顶栏 .pf-round 同款 */
.pf-menu-ico {
  flex: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--c-surface-2);
  color: var(--c-text);
  transition: transform 0.15s var(--ease), background var(--dur) var(--ease);
}
button.pf-menu-item:active .pf-menu-ico {
  transform: scale(0.9);
  background: var(--press-bg);
}

/* 导入 / 导出 PNG 本期不绑任何事件，用最弱字色标明它现在不响应 */
.pf-menu-item.is-idle { color: var(--c-hint); }
.pf-menu-item.is-idle .pf-menu-ico { color: var(--c-hint); }

/* ===== 上方精选角色卡 ===== */
/* 层叠构图：当前卡居中，前后两张缩小平移藏到它背后，左右各露出照片的一条边缘。
 * 照片（.pf-fcard-photo）绝对定位、随状态在左右贴边间平移、从不消失；
 * 文字（.pf-fcard-main）在侧卡状态下淡掉。 */
.pf-featured {
  margin-top: 20px;

  --fc-peek: 60px;               /* 主卡两侧各让出这么宽给侧卡 */
  --fc-edge: 5px;                /* 侧卡外沿离屏幕边的距离 */
  --fc-scale: 0.9;
}

/* 负边距把层叠区顶到屏幕两边，侧卡才有地方露；overflow 兜住露到屏幕外的部分。
 * 高度由 JS 按最高的一张卡写死 —— 卡片全部绝对定位，容器自己撑不起来 */
.pf-fcards {
  position: relative;
  margin: 0 -20px;
  overflow: hidden;
  touch-action: pan-y;           /* 横向手势归卡片，纵向照常滚页面 */

  --fc-drag: 0px;                /* 拖拽中的实时位移，三种状态的 transform 都叠加它 */
}

.pf-fcard {
  position: absolute;
  top: 0;
  left: var(--fc-peek);
  width: calc(100% - var(--fc-peek) * 2);
  min-height: 190px;             /* 给左下角的页码留出照片以外的位置 */
  padding: 14px;
  text-align: left;
  border-radius: 24px;
  background: var(--pf-card-bg);
  /* 去掉阴影后白卡叠白卡没有分界，用发丝描边交代边缘 */
  border: 1px solid var(--c-border-m);
  transform: translateX(var(--fc-drag));
  transition: transform 0.36s var(--ease), opacity 0.36s var(--ease);
}

/* 只有一张时不留侧卡的位置，直接对齐页面左右内边距 */
.pf-fcards.is-solo .pf-fcard {
  left: 20px;
  width: calc(100% - 40px);
}

/* 5% 是 (1 - 0.9) / 2：缩放绕中心发生，先把缩掉的半边补回来，再挪到屏幕边。
 * 改 --fc-scale 必须同步改这两个 5% */
.pf-fcard.is-prev {
  transform: translateX(calc(var(--fc-edge) - var(--fc-peek) - 5% + var(--fc-drag))) scale(var(--fc-scale));
}
.pf-fcard.is-next {
  transform: translateX(calc(var(--fc-peek) - var(--fc-edge) + 5% + var(--fc-drag))) scale(var(--fc-scale));
}

.pf-fcard.is-active { z-index: 3; }
.pf-fcard.is-prev,
.pf-fcard.is-next { z-index: 2; }
/* 再远的卡停在侧卡的位置上但透明：切换时它是从侧卡背后淡出来的，不是凭空出现 */
.pf-fcard.is-far {
  z-index: 1;
  opacity: 0;
  pointer-events: none;
}

/* 跟手期间不能有过渡，否则位移会拖在手指后面 */
.pf-fcards.is-dragging .pf-fcard { transition: none; }

/* 只有文字淡入淡出；照片是独立元素、从不消失，切换时卡片上不会露出白底。
 * 文字部分要给照片让位，左边距 = 照片宽 96 + 间距 14 */
.pf-fcard-main {
  display: flex;
  margin-left: 110px;
  transition: opacity 0.24s var(--ease);
}
.pf-fcard:not(.is-active) .pf-fcard-main { opacity: 0; }

/* 照片脱离文档流，随卡片状态在左右贴边之间平移：
 * 主卡和左侧卡都贴左（左侧卡露照片左半），右侧卡贴右（露照片右半）。
 * left 的两个值都是长度，能整段插值成连续的位移动画 */
.pf-fcard-photo {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 96px;
  height: 132px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--c-surface-2);
  transition: left 0.36s var(--ease);
}
/* 100% 是卡片的 padding box 宽，110 = 照片宽 96 + 右侧 14 */
.pf-fcard.is-next .pf-fcard-photo { left: calc(100% - 110px); }
.pf-fcard-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pf-fcard-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pf-fcard-name {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pf-fcard-type {
  margin: 4px 0 14px;
  /* letter-spacing 会在最后一个字母后面也加一份，左对齐文本不用抵消 */
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  letter-spacing: 0.16em;
  color: var(--c-hint);
}

.pf-fcard-label {
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  letter-spacing: 0.16em;
  color: var(--c-sub);
}

.pf-fcard-value {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pf-fcard-value.is-empty { color: var(--c-hint); font-weight: 400; }

.pf-fcard-line {
  height: 1px;
  margin: 12px 0 10px;
  background: var(--c-border-m);
}

.pf-fcard-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 2px 0;
  font-size: var(--row-value-size);
  line-height: 1.4;
}
.pf-fcard-icon {
  flex: none;
  display: flex;
  align-items: center;
  color: var(--c-accent-dark);   /* reicon 内部用 currentColor */
}
.pf-fcard-val {
  flex: 1;
  min-width: 0;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pf-fcard-val.is-empty { color: var(--c-hint); }

/* 定位基准是 .pf-fcard —— .pf-fcard-main 是静态流，不构成包含块 */
.pf-fcard-index {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--c-surface-2);
  font-size: var(--label-size);
  color: var(--c-sub);
  font-variant-numeric: tabular-nums;
}

/* ===== 四项选择行 ===== */
.pf-tabs-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 20px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--c-surface-2);
}

/* 滑块压在按钮下面（同 .api-tab-ind），位置和宽度由 JS 按实测写入 */
.pf-tab-ind {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border-radius: var(--r-pill);
  background: var(--c-accent-dark);
  transition: transform 0.26s var(--ease), width 0.26s var(--ease);
}

.pf-tab {
  flex: 1 1 0;
  min-width: 0;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  font-size: var(--row-name-size);
  font-weight: var(--row-name-weight);
  letter-spacing: 0.04em;
  color: var(--c-sub);
  white-space: nowrap;
  z-index: 1;
  transition: color var(--dur) var(--ease);
}
.pf-tab.is-active { color: var(--c-bg); }
.pf-tab:active { color: var(--c-text); }
.pf-tab.is-active:active { color: var(--c-bg); }

.pf-tab-group { flex: 0 1 auto; min-width: 52px; }

.pf-tab-group-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== 普通角色卡 ===== */
.pf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.pf-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 10px 10px 6px;
  border-radius: var(--card-radius);
  background: var(--pf-card-bg);    /* 所有卡片统一一个底色，不做深浅两套 */
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s var(--ease);
}
.pf-card:active { transform: scale(0.97); }

.pf-card-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--c-surface-2);
}
/* aspect-ratio 老 Safari 不认，用 padding-top 兜底会引入第二套盒子，这里改成保底高度 */
@supports not (aspect-ratio: 1 / 1) {
  .pf-card-photo { height: 120px; }
}
.pf-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pf-card-name {
  margin-top: 10px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pf-card-type {
  align-self: flex-start;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  background: var(--c-surface-2);
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  letter-spacing: 0.1em;
  color: var(--c-sub);
}

.pf-card-desc {
  margin-top: 8px;
  min-height: calc(2 * 1.45em);   /* 恒占两行，同排卡片等高后不会把余量塞给下面的 margin-top: auto */
  font-size: var(--row-value-size);
  line-height: 1.45;
  color: var(--c-sub);
  /* 两行截断，长描述不撑破卡片 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.pf-card-desc.is-empty { color: var(--c-hint); }

.pf-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}

.pf-card-group {
  min-width: 0;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  background: var(--c-surface);
  font-size: var(--label-size);
  color: var(--c-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pf-fav {
  flex: none;
  width: 44px;                   /* 触控靶区，图标本体只有 16px */
  height: 44px;
  margin-top: -13px;             /* 44px 靶区不参与 foot 行高，否则分组标签上方会多出 13px */
  margin-bottom: -13px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--c-hint);          /* reicon 内部用 currentColor */
  transition: transform 0.15s var(--ease), color var(--dur) var(--ease);
}
.pf-fav:active { transform: scale(0.86); }
.pf-fav[aria-pressed="true"] { color: var(--c-text); }

.pf-empty {
  padding: 48px 24px;
  text-align: center;
  font-size: 14px;
  color: var(--c-hint);
}

.pf-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.pf-actions .api-btn { gap: 8px; }

/* ===== 详情 / 编辑页 ===== */
.pf-detail-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  /* 安全区一律用加法，不能用 max() */
  padding: calc(12px + var(--sat)) 20px calc(32px + var(--sab));
}

.pf-detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
}

/* 导出钮与 DONE 同排靠右，间距与列表页顶栏的两个圆钮一致 */
.pf-detail-acts {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pf-done {
  min-width: 72px;
  height: 40px;
  padding: 0 20px;
  border-radius: var(--r-pill);
  background: var(--c-surface-2);
  font-size: var(--row-name-size);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--c-text);
  transition: transform 0.15s var(--ease), background var(--dur) var(--ease);
}
.pf-done:active {
  transform: scale(0.96);
  background: var(--press-bg);
}

/* ===== 主资料 ===== */
.pf-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 12px;
}

.pf-avatar {
  width: 116px;
  height: 116px;
  padding: 4px;
  border-radius: 50%;
  background: var(--c-bg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s var(--ease);
}
.pf-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--c-surface-2);
}
.pf-avatar:active { transform: scale(0.96); }

/* 走全局二级页标题层级，不另起一套字号 */
.pf-hero-name {
  margin: 12px 0 0;
  max-width: 100%;
  font-size: var(--page-title-size);
  font-weight: var(--page-title-weight);
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--c-text);
  word-break: break-word;
  text-align: center;
}

.pf-hero-summary {
  margin-top: 3px;
  max-width: 100%;
  font-size: var(--row-name-size);
  color: var(--c-sub);
  word-break: break-word;
  text-align: center;
}

.pf-hero-type {
  margin-top: 6px;
  /* letter-spacing 会在最后一个字母后面也加一份，居中文本要补等量左边距抵消 */
  margin-left: 0.16em;
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  letter-spacing: 0.16em;
  color: var(--c-hint);
}

/* ===== 快捷区：左小右大 ===== */
/* 两块之间只留 --card-gap 这一条窄缝，相邻的两个角用小圆角、外侧角用大圆角，
 * 与 API 设置页 PRESETS 行同一套做法 */
.pf-quick {
  display: flex;
  align-items: stretch;
  gap: var(--card-gap);
  margin-top: 22px;
}

.pf-quick-left {
  flex: none;
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 6px;
  /* 左侧外角大、贴着输入框的右侧两角小 */
  border-radius: var(--card-radius) var(--card-radius-in) var(--card-radius-in) var(--card-radius);
  background: var(--c-surface-2);
  font-size: var(--row-value-size);
  color: var(--c-sub);
}
.pf-quick-left re-icon { color: var(--c-accent-dark); }

/* 输入框直接就是这个块本身，里面不要再套一层白底 */
.pf-quick-right {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0 16px;
  /* 贴着左块的左侧两角小、右侧外角大 */
  border-radius: var(--card-radius-in) var(--card-radius) var(--card-radius) var(--card-radius-in);
  background: var(--c-surface-2);
}

.pf-quick-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  /* 必须 >= 16px，否则 iOS 一聚焦就把整页放大 */
  font-size: 16px;
  color: var(--c-text);
  -webkit-appearance: none;
  appearance: none;
}
.pf-quick-input::placeholder { color: var(--c-hint); }

/* ===== 分组小标题：与设置页 / API 页同参数 ===== */
.pf-section-label {
  margin: 26px 0 10px;
  padding-left: 4px;
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  line-height: 1.2;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-hint);
}

/* ===== 面板与字段 ===== */
.pf-panel { display: none; }
.pf-panel.is-active { display: block; }

.pf-field { margin-bottom: 12px; }

.pf-field-label {
  display: block;
  margin: 0 0 8px 4px;
  font-size: var(--row-value-size);
  color: var(--c-sub);
}

.pf-area {
  display: block;
  width: 100%;
  min-height: 140px;
  padding: 14px 16px;
  border: none;
  border-radius: var(--card-radius);
  background: var(--c-surface-2);
  font-family: inherit;
  /* 必须 >= 16px，否则 iOS 一聚焦就把整页放大 */
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-text);
  resize: none;
  -webkit-appearance: none;
  appearance: none;
}
.pf-area::placeholder { color: var(--c-hint); }
.pf-area-sm { min-height: 88px; }

/* 性别选择行 */
.pf-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: var(--field-h);
  padding: 0 16px;
  border-radius: 24px;
  background: var(--c-surface-2);
  text-align: left;
  transition: background var(--dur) var(--ease);
}
.pf-pick:active { background: var(--press-bg); }
.pf-pick-value {
  flex: 1;
  min-width: 0;
  font-size: var(--row-name-size);
  color: var(--c-text);
}
.pf-pick-chevron {
  flex: none;
  display: flex;
  align-items: center;
  color: var(--c-hint);
}

/* 账号非法时才出现的行内提示 */
.pf-error {
  margin: -4px 4px 12px;
  font-size: var(--row-value-size);
  line-height: 1.4;
  color: var(--c-text);
}
/* ===== MANAGE：删除角色 ===== */
.pf-danger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: var(--btn-h);
  border-radius: var(--r-pill);
  background: var(--c-surface-2);
  font-size: var(--row-name-size);
  font-weight: var(--row-name-weight);
  color: var(--c-sub);           /* 全站严格灰阶，危险动作只靠文案区分，不用红色 */
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.pf-danger:active {
  background: var(--c-accent-dark);
  color: var(--c-bg);
}

/* 弹窗里的角色名跟正文同字号，只靠颜色提一档 */
.pf-del-name { color: var(--c-text); }

/* 导入弹窗里的「导入酒馆卡」本期不绑任何事件，用最弱字色标明它现在不响应。
 * 它是 div 不是 button，本来就点不动，这里只补视觉 */
.pf-btn-idle { color: var(--c-hint); }

/* ===== 分页选择器：排在分组下方，跟着页面一起滚 ===== */
/* 底色与指示块保持 API 页原样（--c-surface-2 槽 + 白滑块），不另加白底和阴影 */
.pf-panel-tabs { margin-top: 22px; }
.pf-panel-tabs .api-tab {
  font-size: var(--row-value-size);
  letter-spacing: 0.04em;
}

/* ===== 返回确认弹窗 ===== */
.pf-confirm-card { max-width: 300px; }

.pf-confirm-text {
  padding-bottom: 16px;
  text-align: center;
  font-size: var(--row-value-size);
  line-height: 1.5;
  color: var(--c-sub);
}

.pf-confirm-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* 必须清 flex：.api-btn 的 flex:1 把 flex-basis 压成 0，竖排时高度会塌成文字高 */
.pf-confirm-btns .api-btn {
  flex: none;
  width: 100%;
}

/* 三选一时主操作独占一行、另两个并排，竖着堆三颗太高 */
.pf-leave-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.pf-leave-btns .api-btn-primary { grid-column: 1 / -1; }

/* 减弱动态效果：取消横向位移与按压缩放，折叠与弹窗直接显示 / 隐藏 */
@media (prefers-reduced-motion: reduce) {
  .pf-page,
  .pf-page.show,
  .pf-detail,
  .pf-detail.show {
    transform: none;
    transition: visibility 0s;
  }
  .pf-search { transition: none; }
  .pf-tab-ind { transition: none; }
  .pf-menu {
    transform: none;
    transition: opacity 0.15s linear;
  }
  .pf-menu.show { transform: none; }
  .pf-back { transition: background var(--dur) var(--ease); }
  .pf-back:active,
  .pf-round:active,
  .pf-done:active,
  .pf-avatar:active,
  .pf-card:active,
  .pf-fav:active {
    transform: none;
  }
  /* 精选卡的位移就是布局本身，不能取消，只把切换动画压到几乎瞬间 */
  .pf-fcard,
  .pf-fcard-main,
  .pf-fcard-photo {
    transition-duration: 0.01s;
  }
}
