/* ============================================================================
 * 移动端交互增强层 · interaction-kit.css   （保守版 ik2）
 * ----------------------------------------------------------------------------
 * 【本文件的唯一职责】触摸手势归一。
 *
 * 【血泪契约 —— 任何后续修改都必须遵守】
 *   上一版（ik1）试图在这里"顺手修复"图层与动效，结果把站点改坏了：
 *     · 强行给 .suggest-list 等浮层写 z-index:900，压掉了站点自身的
 *       2147483000，导致下拉浮层被盖住、文字穿透重影；
 *     · 给 .app > * 写 animation:none，摘掉了本站既有的入场动画；
 *     · 给 .ik-indicator 承载激活态并让 .active{background:transparent}，
 *       把底部导航/选项卡的激活背景抹掉，出现"双图重影"；
 *     · 用 !important 改 min-height / gap，直接改动布局。
 *   这些问题的共同点：**动了站点已经正确的既有实现**。
 *
 *   因此本文件从此只允许出现下面两类声明，其余一律禁止：
 *     1) touch-action        —— 手势行为，不参与布局与绘制；
 *     2) -webkit-tap-highlight-color —— 仅在本层显式开启时生效。
 *
 *   明确禁止：z-index / position / transform / animation / transition /
 *   min-height / padding / margin / gap / overflow / filter / background /
 *   color / box-shadow，以及任何形式的 !important。
 *   站点自带的图层体系（下拉 2147483000 < 遮罩 2147483200 < toast 2147483400）
 *   与动效体系（motion-tokens.css / motion-runtime.js）**保持原样，不得接管**。
 *
 * 加载位置：排在 base.css / motion-tokens.css 之后即可，仅作默认值兜底。
 * ==========================================================================*/

/* ---------------------------------------------------------------------------
 * 1. 可点击元素：统一为 manipulation
 *    · 关掉双击缩放与移动端 300ms 点击延迟 → 点击更跟手；
 *    · 站点原本把这条挂在 html[data-query-motion-ready="true"] 下，
 *      一旦后台关闭动效就失效；这里用 :where() 以零特异性补一层无条件兜底，
 *      站点若另有写法（特异性更高）依然优先，不会被本层覆盖。
 * -------------------------------------------------------------------------*/
html body :where(
  button,
  [role="button"],
  a,
  label,
  summary,
  .tab,
  .page-btn,
  .collapse-toggle,
  .pill,
  .tag,
  .chip,
  .system-switch-card,
  .service-card,
  .wish-mode button,
  .smart-batch-btn,
  .filter-multi-option,
  .searchable-select-input,
  .searchable-select-option
) {
  touch-action: manipulation;
}

/* ---------------------------------------------------------------------------
 * 2. 轻量点击高亮（默认关闭）
 *    默认不写任何声明 —— 完全沿用站点/浏览器既有表现，做到"零视觉变化"。
 *    仅当后台把 tapHighlight 设为 soft / none 时，JS 才会打上
 *    html[data-ik-tap-highlight] 属性，此处规则方才生效。
 * -------------------------------------------------------------------------*/
html[data-ik-tap-highlight="soft"] body :where(
  button, [role="button"], a, label,
  .tab, .page-btn, .system-switch-card, .service-card
) {
  -webkit-tap-highlight-color: rgba(40, 117, 212, .10);
}

html[data-ik-tap-highlight="none"] body :where(
  button, [role="button"], a, label,
  .tab, .page-btn, .system-switch-card, .service-card
) {
  -webkit-tap-highlight-color: transparent;
}

/* ---------------------------------------------------------------------------
 * 3. 总开关关闭时：本层不留任何痕迹
 * -------------------------------------------------------------------------*/
html[data-ik="off"] body :where(
  button, [role="button"], a, label, summary,
  .tab, .page-btn, .collapse-toggle, .pill, .tag, .chip,
  .system-switch-card, .service-card,
  .wish-mode button, .smart-batch-btn, .filter-multi-option,
  .searchable-select-input, .searchable-select-option
) {
  touch-action: auto;
}
