/* ============================================================================
 * clib-shell-v1.css —— 融合第二层「壳层组件化」v1（2026-10-14 · CTO）
 * ----------------------------------------------------------------------------
 * 干什么：把**组件层**的取值从"各处写死"收敛成**令牌引用**，第一片只做**圆角**。
 *   为什么先做圆角：全站圆角越界 **1794 处**（12px×405 · 8px×291 · 10px×228 · 6px×149 …），
 *   而《换皮任务-要求与标准总集-综合版》§二-1 只允许四档 **24 / 18 / 14 / 999**。
 *
 * 为什么能覆盖：组件样式写在 `index.html` 的内联 `<style>`（如 `.v17-btn` 在第 50 行），
 *   而本文件由 `<link>` 挂在第 688 行之后 ⇒ **同权重、后到者胜**，无需改那个巨大的内联块。
 *
 * 取值全部走令牌（不许写死数值）：
 *   24 → var(--r-xl)   · 按钮 / 弹窗 / 分段整组
 *   18 → var(--r-18)   · 卡片 / 色块
 *   14 → var(--r-md)   · 输入 / 表格 / 提示条 / 图
 *   999 → var(--r-pill) · 胶囊
 *
 * 开关（一键回退）：把 `index.html` 里本文件那一行 `<link>` 注释掉即回到改动前；
 *   整层回退另可 `git revert` 本笔。**本文件只动圆角，不动布局/间距/字号/字体/动效。**
 *
 * 判据（可复跑 · 分两类，别混）：
 *   ① 源码面：`node work/_audit/design-token-guard.js` —— 新增越界必须 0。
 *      ⚠️ **本层不改旧声明，所以它的 ④ 越界数不会下降**（仍 1794）。那是历史欠账，
 *         要降必须**改写**旧声明（属第二层后续片），不是靠覆盖。
 *   ② 运行时面：**浏览器 computed style**（唯一能证明"覆盖真的生效"的判据）——
 *      例：`.v17-btn` 的计算圆角应为 24px、`.tile` 应为 18px、`.v17-field` 应为 14px。
 *   ③ 令牌面：`node work/_audit/token-align.js` —— 缺口/冲突必须 0。
 * ========================================================================== */

:root {
  /* 组件层语义别名：以后改组件圆角只改这里，页面与内联块都不用碰 */
  --c-btn-r: var(--r-xl);    /* 按钮 · 24 */
  --c-card-r: var(--r-18);   /* 卡片 · 18 */
  --c-field-r: var(--r-md);  /* 输入 · 14 */
  --c-cap-r: var(--r-pill);  /* 胶囊 · 999 */
}

/* ⚠️ 为什么每条都带 `!important`：旧层（clib-v24-polish / clib-v3-tokens / style.eb58df29）里
   已有 **3229 处 `!important`**，实测不带它就压不住。这是"覆盖式"的代价。
   ⇒ **能改写就别覆盖**：按钮那组已由 `6490bf51` 在 `clib-design-system.css` 里**从根上改写**
   （`button:not(…)×6` 那条的 `--r-md` 14 → `--r-xl` 24，运行时实测 24px），
   所以本文件**删掉了按钮覆盖组**（留着是死重、也会掩盖真正的定义）。
   **后续每有一处改成"改写旧声明"，就回来删掉对应覆盖条。** */

/* ── 卡片 / 色块（tile 15 次 · 大厅卡 · 面板）── */
.tile, .kcard, .card, .panel, .qa-card, .v17-card {
  border-radius: var(--c-card-r) !important;
}

/* ── 输入 / 表单 / 提示条 ── */
.v17-field, .v17-form input, .v17-form select, .v17-form textarea,
input[type="text"], input[type="password"], input[type="email"], input[type="search"], select, textarea,
.tip, .notice {
  border-radius: var(--c-field-r) !important;
}

/* ── 空态（qa-empty 23 次 · v17-empty 23 次）── */
.qa-empty, .v17-empty {
  border-radius: var(--c-card-r) !important;
}

/* ── 胶囊（页签 chip / 标签 / 徽标）── 注：`.v17-label` 故意不列（多为文本标签，加胶囊可能反效果） */
.v17-qtab, .chip, .tag, .pill, .badge {
  border-radius: var(--c-cap-r) !important;
}

/* ── 390 窄屏导航修复 v2（2026-10-15 · 兄弟选①：只收起导航、h1 一字不动）─────────
   **先取证再改**（探针 `work/_audit/_nav-measure-probe.js`，390 实测）：
     `#hcNav` → **position:absolute · top:0 · z-index:60 · height:213.75px**（脱离文档流、浮在顶部）
     `nav.top` 在其内（relative · h=212.75px）；`a.goldpill` rect 78–129；`h1` rect **63–141**
     ⇒ **导航条占 0–213 纵向区间，而 h1 从 63 开始** ⇒ 两者必然重叠（h1 被浮层压住）。
   修法（最小 · 不减少入口 · h1 内容/字号不动）：**先把 `#hcNav` 放回文档流** ⇒ 它占住自身高度，
   hero 随流自然下移，重叠消失；导航项**一个不少**（仍在、仍可点）。
   权重依据：`#hcNav`＝(1,0,0)，与定义处同权重；本层在 home-v5.css 之后加载 ⇒ 同权重后者胜（v1 用
   `nav.top`＝(0,0,1) 被 `#hcNav nav.top`＝(1,0,1) 压掉，才"没生效"）。
   开关：注释掉本段即回到改动前；或整层注释掉 index.html 里 clib-shell-v1.css 那一行 <link>。 */
@media (max-width: 430px) {
  /* v3：**必须抬到更高权重**。取证：home-v5.css:349 ＝ `#hcNav{position:absolute !important}`（(1,0,0)），
     与 v2 用的 `#hcNav` **同权重**；v2 仍无效 ⇒ 说明 home-v5.css 比本层**加载得更晚**（同权重后者胜）。
     ⇒ 改用 **`#hcRoot #hcNav`（(1,1,0)）**，严格高于它，**不受加载顺序影响**。 */
  #hcRoot #hcNav, #hcRoot #hcNav nav.top {
    position: static !important;
    top: auto !important;
    height: auto !important;
    max-height: none !important;
    flex-wrap: wrap !important;
    row-gap: 8px !important;
  }
  #hcRoot #hcNav {
    z-index: auto !important;
  }
}
