/* ============================================================
   HyApexFlow — Design Fix Layer v1.0
   修复目标（用户视角可读性与一致性）：
     1. 正文对比度  #808285(3.85:1) → #475569(7.58:1)
     2. 色板统一    落地页 .hy-home 变量映射回主 token
     3. 字体        自托管 Inter（latin + latin-ext 覆盖西/法重音）
     4. 青色小标签  #00a8cc(2.81:1) → #007a99(4.95:1)
     5. 字号收敛    10.4/12/13.6/14/14.4 五档 → 12/14/16 三档
     6. 行高统一    正文 1.5 → 1.65

   设计原则：
     - 纯叠加层，不修改任何原有 CSS / 页面 HTML
     - 用特异性（html body / 重复类）而非 !important 取胜，确保
       加载顺序无论如何都能覆盖
     - 回滚方式：把 functions.php 里 hyapexflow-design-fix 一行注释掉
   ============================================================ */

/* ---------- 1. 自托管 Inter（可变字体，100–900 全权重） ---------- */
/* latin 子集：EN 页面只加载这 46KB */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext 子集：ES/FR 页面按需加载（ñ é è ç œ 等） */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- 2. 全站字体：Inter 优先，中英文各有兜底 ---------- */
html body,
html body p,
html body li,
html body span,
html body a,
html body td,
html body th,
html body label,
html body input,
html body textarea,
html body select,
html body button,
html body h1, html body h2, html body h3,
html body h4, html body h5, html body h6 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, 'Noto Sans', 'PingFang SC', 'Microsoft YaHei',
    sans-serif;
}

/* ---------- 3. 正文对比度修复（核心） ---------- */
/* Astra 默认 body 灰 #808285 = 3.85:1，未达 WCAG AA */
html body {
  color: var(--hy-text, #475569); /* 7.58:1 —— AAA */
}

/* bootstrap 的 .text-muted / .text-secondary 自带 !important，必须反制 */
html body .text-muted.text-muted,
html body .text-secondary.text-secondary {
  color: #5a6976 !important; /* 浅底 5.29:1 —— AA（原 #6c757d 浅底仅 4.39:1） */
}

/* ---------- 4. 色板统一：落地页 .hy-home 映射回主 token ---------- */
/* 重复类选择器提升特异性，无需 !important 即可覆盖原声明 */
.hy-home.hy-home {
  --navy: var(--hy-dark, #0b1b2b);
  --blue: var(--hy-primary, #0056b3);
  --blue-700: var(--hy-primary-dark, #004080);
  --teal: var(--hy-secondary, #00a8cc);
  --teal-700: var(--hy-aqua-deep, #007a99);
  --ink: var(--hy-dark, #0b1b2b);
  --ink-2: var(--hy-text, #475569);
  --mut: var(--hy-muted, #6c757d);
  --bg: var(--hy-light, #f4f8fb);
  --line: var(--hy-border, #e1e8ed);
  /* --gold 保留为落地页 CTA 专属强调色（深字 #10233a + 金底 = 7.75:1）
     如需与主站行动橙统一，改为 var(--hy-ember) 即可，一行可切 */
}

/* ---------- 5. 青色文字：浅底加深，深底保持亮青 ---------- */
/* 子主题 `:root .text-info` 特异性实为 (0,2,0)（:root 计入伪类）且带 !important，
   故此处用重复类把特异性抬到 (0,2,2)，并同样 !important 才能反制 */
html body .text-info.text-info {
  color: #007a99 !important; /* 白底 4.95:1 —— AA（原 #00a8cc 仅 2.81:1） */
}
/* 深色容器内的青色文字回退为亮青，保证深底对比度 6.20:1 */
.hy-hero .text-info.text-info,
.hy-cta .text-info.text-info,
.hy-footer .text-info.text-info,
.hy-home .cta .text-info.text-info {
  color: var(--hy-secondary, #00a8cc) !important;
}

/* ---------- 6. 字号收敛：五档 → 三档（12 / 14 / 16） ---------- */
/* 10.4px 低于可读下限，提升至 12px */
html body .hy-product-subnav .badge {
  font-size: .75rem; /* 12px */
}
/* 13.6px / 14.4px 归入 14px */
html body .hy-footer-bottom {
  font-size: .875rem; /* 14px */
}
html body .hy-footer-desc,
html body .hy-footer-links a,
html body .hy-trust-item p,
html body .hy-cert-badge p,
html body .hy-img-placeholder-inner p {
  font-size: .875rem; /* 14px */
}
/* 12px 档位保留（标签类，非阅读文本） */
html body .hy-cert-pending,
html body .hy-case-pending {
  font-size: .75rem;
}

/* ---------- 7. 行高统一：正文 1.65 ---------- */
html body p,
html body li,
html body .lead {
  line-height: 1.65;
}

/* ---------- 8. 数字等宽：防止数据跳动（精细度） ---------- */
html body .hy-stat-num,
html body table td,
html body table th {
  font-variant-numeric: tabular-nums;
}

/* ---------- 9. 链接可读性 ---------- */
html body a:not(.btn):not(.hy-btn) {
  text-underline-offset: 2px;
}
