/* ==========================================================================
   lg-contrast2.css —— 全站对比度修复（第二批）
   --------------------------------------------------------------------------
   ★ 起因
     用户 2026-10-22 09:34：「优惠卷付款界面，白色和透明为底，浅色黄色字体显示不清晰」
     lead 已修该处（lg-contrast.css，11/11 通过）。本文件处理**同类的其它处**。

   ★ 发现方法（前三版方法都错，第四版才对）
     ① 解析线上 CSS：437,826 B / 3,521 规则 / 1,401 条 color 声明
     ② 按（归一化选择器 × 主题）**级联解析**，取源码最后一条 color / background
        —— 不做级联会把「深色主题的深色覆盖」漏掉，误报 85%~92%
     ③ 只留「同规则内同时定义 color 和 background」的 SELF 条目
        ⛔ 不做任意深度祖先背景推断（那是误报主因）
     ④ 生成**真实浏览器验证页**（真实线上 CSS + data-v scoped 属性）实测
        —— 这一步又抓出 3 类假象：漏 data-v、白底兜底、渐变未解析
     ⑤ **修复值用实测的 fg/bg 算**，不用静态推断值
        —— 用静态值算导致 3 处回退（实测本来合格的被改坏）

   ★ 修法
     · 白字压浅色徽章 ⇒ **压深背景**（保留反白观感，只降明度）
     · 彩色字压浅底   ⇒ **压深文字**；深色底深色字 ⇒ 提亮文字
     · 保持 HSL 的 H 与 S 不变，只动 L（不换色相）
     · 每个语义档位独立目标：正文 7.0:1 / 弱化 4.6:1 / 徽章 4.6:1
       ⛔ 不能都压到 4.5:1，否则「次要」与「弱化」撞成同色 ⇒ 层级塌掉
     · ⛔ 不动布局 / 尺寸 / 圆角 / 间距 / 动画

   ★ 特异性
     本文件在主 CSS 之后加载。html:root 把 (0,1,0) 提到 (0,2,1)，无需 !important；
     深色主题块与主 CSS 同名规则同特异性，靠加载顺序取胜，故加 !important。

   ★ 所有数值由 audit/gen_contrast2c.py 用 WCAG 公式计算并验证
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 白字压在浅色徽章上 —— 压深背景，保留白字
   -------------------------------------------------------------------------- */
html[data-theme="dark"] .chv-mentiondot { background-color: #a3680b !important; }
   /* [dark] bg #f0a020 -> #a3680b : 2.15 -> 4.62 */
html[data-theme="dark"] .chv-nti-ic { background-color: #627693 !important; }
   /* [dark] bg #94a3b8 -> #627693 : 2.56 -> 4.63 */
html[data-theme="dark"] .lvp-retry { background-color: #0052c2 !important; }
   /* [dark] bg #7db4ff -> #0052c2 : 2.13 -> 7.03 */
html:root .chv-mentiondot { background-color: #a3680b; }
   /* [light] bg #f0a020 -> #a3680b : 2.15 -> 4.62 */
html:root .chv-nti-ic { background-color: #627693; }
   /* [light] bg #94a3b8 -> #627693 : 2.56 -> 4.63 */

/* --------------------------------------------------------------------------
   2. 彩色字压在浅底 —— 压深文字（徽章）
   -------------------------------------------------------------------------- */
html[data-theme="dark"] .lv-b4>.lv-badge-t { color: #975c07 !important; }
   /* [dark] fg #a16207 -> #975c07 : 4.15 -> 4.60 */
html[data-theme="dark"] .srp-seal { color: #582600 !important; }
   /* [dark] fg #8a3b00 -> #582600 : 2.87 -> 4.60 */
html:root .lv-b4>.lv-badge-t { color: #975c07; }
   /* [light] fg #a16207 -> #975c07 : 4.15 -> 4.60 */
html:root .srp-seal { color: #582600; }
   /* [light] fg #8a3b00 -> #582600 : 2.87 -> 4.60 */

/* --------------------------------------------------------------------------
   3. 图标 / 星标 —— 压深
   -------------------------------------------------------------------------- */
html[data-theme="dark"] .fbv-stars { color: #8c6503 !important; }
   /* [dark] fg #fbbf24 -> #8c6503 : 1.45 -> 4.61 */
html:root .fbv-stars { color: #9a6306; }
   /* [light] fg #f59e0b -> #9a6306 : 1.96 -> 4.61 */

/* --------------------------------------------------------------------------
   4. 弱化文字（4.20~4.41，差一点点）—— 压深到 4.6:1
   -------------------------------------------------------------------------- */
html[data-theme="dark"] .aghpf-ipcur { color: #047555 !important; }
   /* [dark] fg #047857 -> #047555 : 4.41 -> 4.61 */
html[data-theme="dark"] .fbs-aidir { color: #5e6f8f !important; }
   /* [dark] fg #9aa6bd -> #5e6f8f : 2.23 -> 4.61 */
html[data-theme="dark"] .mv-rncx { color: #5c6d8d !important; }
   /* [dark] fg #9aa6bd -> #5c6d8d : 2.17 -> 4.61 */
html:root .aghpf-ipcur { color: #047555; }
   /* [light] fg #047857 -> #047555 : 4.41 -> 4.61 */
html:root .fbs-aidir { color: #607086; }
   /* [light] fg #64748b -> #607086 : 4.32 -> 4.61 */
html:root .mv-rncx { color: #5e6e83; }
   /* [light] fg #64748b -> #5e6e83 : 4.20 -> 4.61 */

/* --------------------------------------------------------------------------
   5. 用户投诉同款：浅色文字压白底 —— 压深到 7:1
   -------------------------------------------------------------------------- */
html[data-theme="dark"] .lvp-retry { background-color: #0052c2 !important; }
   /* [dark] bg #7db4ff -> #0052c2 : 2.13 -> 7.03 */
html[data-theme="dark"] .srp-skip { color: #814d00 !important; }
   /* [dark] fg #ffe9c9 -> #814d00 : 1.18 -> 7.03 */
html:root .srp-skip { color: #814d00; }
   /* [light] fg #ffe9c9 -> #814d00 : 1.18 -> 7.03 */

/* --------------------------------------------------------------------------
   6. 系统「更高对比度」偏好
   ⛔ 只影响偏好分支，不改默认状态
   -------------------------------------------------------------------------- */
@media (prefers-contrast: more) {
  html:root .aghpf-ipcur { color: #000000; }
  html:root .fbs-aidir { color: #000000; }
  html:root .lvp-retry { color: #000000; }
  html:root .mv-rncx { color: #000000; }
  html:root .srp-skip { color: #000000; }
}


/* --------------------------------------------------------------------------
   7. ★ 深色主题：白底 + 浅字（真机复测确认，5 处）
   --------------------------------------------------------------------------
   背景是**实色浅底**，不是渐变也不是兜底白 —— 这一点用真机 getComputedStyle 确认过：
     .acp-tabs button          bg = rgb(255, 255, 255)        ← 纯白
     .acp-in                   bg = rgba(255,255,255,0.82)    ← 82% 白
     .agh-mdlt-size            bg = rgb(255, 255, 255)        ← 纯白
     .agh-mdlt-table thead th  bg = rgb(244, 247, 251)        ← 近白
     .mv-state                 bg = rgba(255,255,255,0.72)    ← 72% 白
   而深色主题下 --bg-ink 变成 #e8ecf6（浅色），--routine 变成 #c3cbdb（浅色）
   ⇒ 浅字压白底 = 1.18 ~ 1.78:1，几乎看不见

   ★ 为什么改背景而不是改文字
     这些是「登录标签栏 / 输入框 / 表头 / 状态条」，
     深色主题下它们本来就该是深色表面。
     压深文字会变成「白底黑字」——在深色界面里更突兀。

   ★ 为什么用 #1e2638
     站点深色主题里 .agh-idbar 用的就是 #1e2638，保持一致。
     #1e2638 上 #e8ecf6 = 12.5:1，上 #c3cbdb = 9.1:1，上 #9aa6bd = 6.1:1
   -------------------------------------------------------------------------- */
html[data-theme="dark"] .acp-tabs button {
  background-color: #1e2638 !important;
}
   /* #e8ecf6 on #ffffff : 1.18 -> on #1e2638 : 12.5 */

html[data-theme="dark"] .acp-in {
  background-color: #1e2638 !important;
}
   /* #e8ecf6 on rgba(255,255,255,.82) : 1.18 -> on #1e2638 : 12.5 */

html[data-theme="dark"] .agh-mdlt-size {
  background-color: #1e2638 !important;
}
   /* #c3cbdb on #ffffff : 1.63 -> on #1e2638 : 9.1 */

html[data-theme="dark"] .agh-mdlt-table thead th {
  background-color: #1e2638 !important;
}
   /* #c3cbdb on #f4f7fb : 1.52 -> on #1e2638 : 9.1 */

html[data-theme="dark"] .mv-state {
  background-color: #1e2638 !important;
}
   /* #9aa6bd on rgba(255,255,255,.72) : 1.78 -> on #1e2638 : 6.1 */

/* 兼容「跟随系统深色」（未显式设 data-theme 的情况） */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .acp-tabs button,
  html:not([data-theme="light"]) .acp-in,
  html:not([data-theme="light"]) .agh-mdlt-size,
  html:not([data-theme="light"]) .agh-mdlt-table thead th,
  html:not([data-theme="light"]) .mv-state {
    background-color: #1e2638 !important;
  }
}


/* --------------------------------------------------------------------------
   8. 白字压在浅色上（第二批，CSS 变量可精确计算，无需真机）
   --------------------------------------------------------------------------
   .ap-btn--primary   color:#fff  bg:var(--a-accent)
       light --a-accent = #3a6df0  → 白字 4.65:1  ✅ 不动
       dark  --a-accent = #6f96ff  → 白字 2.56:1  ❌ 压深按钮底色
       ⛔ 不改 --a-accent 变量本身（它还被文字/图标用），只改这个按钮的背景

   .aghpf-badge-gold  color:#fff  bg:linear-gradient(135deg,#f59e0b,#d97706)
       #f59e0b → 白字 2.23:1  ❌
       #d97706 → 白字 3.39:1  ❌
       ⇒ 金色渐变整体压深（保持金色相），白字保留
   -------------------------------------------------------------------------- */
html[data-theme="dark"] .ap-btn--primary {
  background-color: #3068ff !important;
  background-image: none !important;
}
   /* #fff on #6f96ff : 2.56 -> on #3068ff : 4.60 */

html:root .aghpf-badge-gold {
  background-image: linear-gradient(135deg, #a36907, #b06105) !important;
}
   /* #fff on #f59e0b/#d97706 : 2.23/3.39 -> on #a36907/#b06105 : 4.61/4.61 */


/* --------------------------------------------------------------------------
   9. 白字压在浅色渐变上（第三批 · 真实浏览器像素实测）
   --------------------------------------------------------------------------
   .acp-go        color:#fff  bg:linear-gradient(135deg,var(--brand-blue),#2563eb)
   .lv-grant-go   color:#fff  bg:linear-gradient(135deg,var(--brand-blue),var(--brand-cyan))

   深色主题下 --brand-blue = #7db4ff（浅蓝）
     #fff on #7db4ff = 2.13:1   ❌ 远低于 4.5:1

   ★ 实测值（不是推算）：把线上 index-j9BAMpnq.css + 本文件 + lg-contrast.css
     用真实 data-v 属性渲染，截图后逐像素采样
       .acp-go                     渐变起点 rgb(123,178,254) → 2.18:1
       .lv-grant-go[data-v-5135e7b2] 渐变起点 rgb(104,168,234) → 2.51:1
       .lv-grant-go[data-v-900e37d8] 渐变起点 rgb(100,165,230) → 2.60:1
     字号 13.5px/800 与 12.5px/800 都属「正文小字」⇒ 门槛 4.5:1

   ★ 为什么压深背景而不是把文字改黑
     这两个是**主操作按钮**（登录 / 领取），深色界面里主按钮应是白字压深蓝。
     改成深字压浅蓝会变成「浅蓝大色块」，在深色界面里更突兀。

   ★ 为什么用 #2563eb / #1d4ed8 / #0e7490
     #fff on #2563eb = 5.17:1   ✅
     #fff on #1d4ed8 = 6.56:1   ✅
     #fff on #0e7490 = 5.36:1   ✅
     末端沿用原设计的色相，只把「起点」从浅蓝换成深蓝。

   ⛔ 不改 --brand-blue 变量本身 —— 它还被文字 / 图标 / 描边使用
   -------------------------------------------------------------------------- */
html[data-theme="dark"] .acp-go {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
}
   /* #fff on #7db4ff : 2.13 -> on #2563eb : 5.17 */

html[data-theme="dark"] .lv-grant-go {
  background: linear-gradient(135deg, #2563eb 0%, #0e7490 100%) !important;
}
   /* #fff on #7db4ff : 2.13 -> on #2563eb : 5.17 */

/* 兼容「跟随系统深色」（未显式设 data-theme 的情况） */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .acp-go {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  }
  html:not([data-theme="light"]) .lv-grant-go {
    background: linear-gradient(135deg, #2563eb 0%, #0e7490 100%) !important;
  }
}

/* --------------------------------------------------------------------------
   9b. 同类补漏（系统性扫描出来的另外 3 条）
   --------------------------------------------------------------------------
   ★ 为什么会有这一节
     9 节只修了 glass-web 报的 .acp-go，但**真机上那个按钮不是 .acp-go** ——
     我用 bsk 取到真实 DOM：<button class="acp-b2 primary">登录</button>
     ⇒ 于是做了一次全量扫描：主 CSS 里「color:#fff + 背景含 var(--brand-blue)」
       的规则一共 **7 条**，9 节只覆盖了 4 条（.acp-go / .lv-grant-go ×2 是我修的，
       .lvp-retry 是本来就有的），漏了下面 3 条。

   ★ 三条的共同点：深色主题下 --brand-blue = #7db4ff，白字 2.13:1
   ★ 修法同上：只压深渐变起点，⛔ 不动 --brand-blue 变量
   -------------------------------------------------------------------------- */
html[data-theme="dark"] .acp-b2.primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
}
   /* #fff on #7db4ff : 2.13 -> on #2563eb : 5.17
      ← 真机上 .acp-b2.primary 实测渐变起点 rgb(120,176,254) = 2.22:1 */

html[data-theme="dark"] .fbs-seg button.on {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
}
   /* #fff on #7db4ff : 2.13 -> on #2563eb : 5.17 */

/* 兼容「跟随系统深色」 */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .acp-b2.primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  }
  html:not([data-theme="light"]) .fbs-seg button.on {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  }
}
