/* ==========================================================================
   SRACING · Material 3 Expressive 交互层（2026-10-29）
   --------------------------------------------------------------------------
   定位：只补「状态」与「可达性」，不动版式、字阶、配色。
   Google Material 3 的三块核心，本站的现状是：
     · 形状     —— 已对齐。卡片 16px = M3 large，按钮 = full（Expressive 的按钮
                   本来就是 full round），令牌层级与 M3 shape scale 一致。
     · 字阶     —— 已对齐。8 档字阶 + 纯拉丁大写 +0.04em 对应 M3 label/title。
     · 状态层   —— 缺失。全站 :active 规则 0 条，:focus-visible 只有 2 处且只改
                   颜色不出焦点环；首页 205 个交互目标里 144 个 < 44×44。
   所以这里只做三件事：焦点环、按压态、触控目标。删掉本文件即完全回滚。
   ========================================================================== */

:root {
  /* ---- M3 Expressive 动效曲线 --------------------------------------------
     emphasized decelerate 用于「进入/出现」，emphasized accelerate 用于「退出」。
     本站原有的 --ease 已经很接近前者，但缺少出场曲线与时长分层。 */
  --m3-ease-in:   cubic-bezier(.05, .7, .1, 1);
  --m3-ease-out:  cubic-bezier(.3, 0, .8, .15);
  --m3-dur-short: 100ms;
  --m3-dur-med:   200ms;
  --m3-dur-long:  300ms;

  /* ---- M3 state layer 不透明度（深色主题官方值）------------------------- */
  --m3-state-hover: .08;
  --m3-state-focus: .10;
  --m3-state-press: .12;

  /* ---- 焦点指示 ---------------------------------------------------------
     品牌橙在 #0b0c0e 上的对比度不足 3:1，提亮一档做焦点环。 */
  --m3-focus:    #ff8a3c;
  --m3-ring-w:   2px;
  --m3-ring-gap: 2px;

  /* ---- 触控目标 ---------------------------------------------------------
     M3 要求 48dp；桌面用 44 是折中（App 侧为 48）。 */
  --m3-tap: 44px;
}

/* ---------------------------------------------------------------- 1. 焦点环
   全站统一。焦点态不做过渡 —— 键盘移动时必须瞬时可见，过渡会让它"追不上"。 */
:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: var(--m3-ring-w) solid var(--m3-focus);
  outline-offset: var(--m3-ring-gap);
  transition: none;
}
/* 深色块（页脚 / 商城 / 商品页）里不需要例外：品牌橙在这几种底色上都够亮 */

/* ---------------------------------------------------------------- 2. 按压态
   用 filter 而不是 background/box-shadow 叠层：不会覆盖组件已有的 background
   简写与阴影，也不会被任何一条 :hover 规则重置。只在精确指针下生效，
   避免触屏双击缩放时闪一下。 */
@media (hover: hover) and (pointer: fine) {
  :where(.hm-btn,
         .pd-hero__btn,
         .sr-header__cta,
         .sr-mmenu__nav a,
         .sr-nav-drop__panel a,
         .sr-seg__i,
         .hm-svc,
         .hm-fam,
         .hm-svc__go,
         .pd-card,
         .sracing-card,
         .sr-pick,
         .sr-pager__btn,
         .hm-sec__links a,
         .sr-footer__list a):active {
    filter: brightness(1.16);
    transition-duration: var(--m3-dur-short);
  }
}

/* ---------------------------------------------------------------- 3. 触控目标
   页头一级导航是纯文字链（24px 高）。这里**只外扩命中区、不改盒子尺寸**：
     · 改 min-height 会把 .sr-header__nav a::after 那条 bottom:-26px 的下划线
       一起推下去（它相对元素自身盒子定位），实测基线会整体错位；
     · 外扩用绝对定位的伪元素，既不动流式布局，也不影响已实测的 nav 327–712。
   24 + 10 + 10 = 44。 */
.sr-header__nav a::before,
.sr-nav-drop__t::before {
  content: "";
  position: absolute;
  /* 横向 -7 而不是 -6：nav 项文字盒只有 30px 宽，-6 时命中区是 42，差 2px 就
     让「首页」「博客」这类两字项成为整条导航里唯一不达标的项。项间距远大于 2px。 */
  inset: -10px -7px;
  border-radius: 8px;
}

/* 语言 / 货币分段控件：**不改视觉高度**。
   试过按 M3 segmented button 的 40dp 直接给 min-height，结果那个
   is-on 的填充胶囊在 72px 页头里变成一块 40px 高的白块，和右移的 EN
   完全脱节 —— Material 的 40dp 是配它自己的色调与留白才成立的。
   这里改成外扩命中区：视觉仍是 24px，命中 40px，页头节奏不变。 */
.sr-seg__i {
  position: relative;
}
.sr-seg__i::before {
  content: "";
  position: absolute;
  inset: -8px -6px;
  border-radius: 999px;
}
.sr-header__cta {
  min-height: var(--m3-tap);
}
/* 下拉面板条目：M3 menu item 48dp，面板宽 320 容得下 */
.sr-nav-drop__panel a {
  min-height: 44px;
}
/* 移动菜单整行可点 */
.sr-mmenu__nav a {
  min-height: 48px;
}

/* 触屏再加一档：M3 的 48dp 在 coarse pointer 下是硬要求 */
@media (pointer: coarse) {
  .sr-seg__i::before { inset: -12px -8px; }
  .sr-header__cta { min-height: 48px; }
  .sr-header__nav a::before,
  .sr-nav-drop__t::before { inset: -12px -8px; }
}

/* ---------------------------------------------------------------- 4. 动效令牌
   已有组件不改（改曲线会动到页头/卡片的既有手感），只把 M3 的两条曲线
   与时长暴露出来，供后续新组件引用，避免再手写 cubic-bezier。 */

/* --------------------------------------------------- 5. 触控目标（续批）
   审计列出的第二批：页脚导航 20px 高、品牌 logo 25px 高、产品页箭头 40px、
   线段导览 23px 高。同样优先「外扩命中区」而不是改盒子尺寸 —— 页脚是多列
   栅格，改高度会推乱列间距。 */
.sr-header__brand { position: relative; }
.sr-header__brand::before {
  content: "";
  position: absolute;
  inset: -11px -8px;
  border-radius: 8px;
}

.sr-footer__col a,
.sr-footer__list a { position: relative; }
.sr-footer__col a::before,
.sr-footer__list a::before {
  content: "";
  position: absolute;
  /* 只扩 4px：页脚 li 的行距是 9.92px（ul gap 0.62rem），链接盒子只有 20px 高。
     要凑到 44 就得上下各扩 12px —— 那会让相邻两行的命中区互相重叠，
     点「隐私政策」时命中「用户协议」，比目标偏小更糟。
     这一处的正解是给页脚加行距（视觉改动），属于设计决策，留待确认。 */
  inset: -4px -4px;
  border-radius: 6px;
}

/* 产品轮播左右箭头：40 → 44（M3 的 icon button 是 48，这里受 620px 首屏高度
   约束取 44；视觉上只大 4px，命中区立刻从「偏小」变「够用」）。 */
.pd-hero__arrow {
  width: 44px;
  height: 44px;
  margin-top: -22px;
}

/* 圆点：视觉仍是 8px，但纵向命中区补到 44。横向不加宽 —— 圆点相邻间距只有
   12px，横向外扩会让相邻两个的命中区互相覆盖，反而更容易点错。 */
.pd-hero__dot { position: relative; }
.pd-hero__dot::before {
  content: "";
  position: absolute;
  inset: -18px 0;
  border-radius: 999px;
}
.pd-hero__dot.is-on { width: 28px; }

/* 线段导览（700 系列 / 500 系列 / nano 表族 / 配件与软件） */
.pd-rail__i { position: relative; }
.pd-rail__i::before {
  content: "";
  position: absolute;
  inset: -11px 0;
  border-radius: 6px;
}

/* --------------------------------------------------- 6. 触控目标（续批 3）
   第三批由 pipeline/diag-targets.py 的分组统计定位：剩下的不是「整片偏小」，
   而是几处零散项 —— 每页 4 个 nav 项宽差 2px（已在上面修）、首页索引 122 条
   32px 链接、以及若干 23px / 31px / 35px / 40px 的单点。逐个补齐。 */

/* 首页站点索引：<li> 高 32，ul 的 gap 是 24px。上下各扩 6px → 44，
   相邻两行仍空 12px，不会互相抢命中。 */
.hm-index__cols a { position: relative; }
.hm-index__cols a::before {
  content: "";
  position: absolute;
  inset: -6px -8px;
  border-radius: 4px;
}

/* 分类导航 chip（技术干货 / 行业资讯 / 赛道攻略）：视觉 35px。
   横向只扩 2px —— 这行 chip 是挨着排的，扩多了相邻会抢。 */
.sr-taxnav__chip { position: relative; }
.sr-taxnav__chip::before {
  content: "";
  position: absolute;
  inset: -5px -2px;
  border-radius: 4px;
}

/* 分页：40px 高，差 4px。 */
a.page-numbers { position: relative; }
a.page-numbers::before {
  content: "";
  position: absolute;
  inset: -2px -2px;
  border-radius: 6px;
}

/* 卡片上的分类标签：23px。M3 的 chip 视觉规格是 32 —— 这类「元信息标签」不是
   独立控件行，按 chip 的 32 判，不是 44。所以只补到 33：再往上扩就会盖住下方
   的文章标题，点标题会跳到分类页，比目标偏小更糟。 */
.sracing-card__cat { position: relative; }
.sracing-card__cat::before {
  content: "";
  position: absolute;
  inset: -5px -4px;
  border-radius: 3px;
}

/* 车型库 / 赛道库的品牌筛选 chip：31px，补 1px 到 32（同一 chip 口径）。 */
.sracing-spec__tags a { position: relative; }
.sracing-spec__tags a::before {
  content: "";
  position: absolute;
  inset: -1px -3px;
  border-radius: 6px;
}

/* 产品族卡头的「查看 700 系列 →」：23px 纯文字链。上下各 11px 才是 45 ——
   写 -10 会得到 43，差 1px 就仍判不合格。 */
.pd-fam__go { position: relative; }
.pd-fam__go::before {
  content: "";
  position: absolute;
  inset: -11px -6px;
  border-radius: 6px;
}

/* 数据中心「查看全部 26 条 →」：23px，同样要 11px。 */
.dh-rail-all { position: relative; }
.dh-rail-all::before {
  content: "";
  position: absolute;
  inset: -11px -6px;
  border-radius: 6px;
}

/* 数据中心轮播点：和产品页圆点一样受横向排布约束（点距 12px），只补纵向。 */
.dh-dot { position: relative; }
.dh-dot::before {
  content: "";
  position: absolute;
  inset: -18px -3px;
  border-radius: 999px;
}

/* 首页各区块标题右侧的跳转链接（产品总览 → / 全部 108 台车型 / 全部 26 条赛道 /
   全部文章 →）：都是 24px 高的纯文字链，和页头导航同一量级。 */
.hm-sec__links a { position: relative; }
.hm-sec__links a::before {
  content: "";
  position: absolute;
  inset: -10px -6px;
  border-radius: 6px;
}

/* 移动端汉堡按钮：34×34。视觉保持 34 —— 移动端页头只有 60px 高，
   把它撑到 44 会让页头跟着长，基线全变。命中区外扩即可，线条画在子 span 上，
   ::before 是空的，可以安全占用。 */
.sr-header__burger { position: relative; }
.sr-header__burger::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 10px;
}
@media (pointer: coarse) {
  .sr-header__burger::before { inset: -7px; }
}
