/* ============================================================
   a11y.css — 可访问性/对比度/触控尺寸统一修正层（2026-10-01）
   必须在页面自身的 <style> 之后加载（文档顺序在后 → 同特异性覆盖生效）。
   背景：独立模板（blog / faq / news）不加载 site.css，各自内联了老值：
     · 文字低于 12px（0.65~0.78rem）
     · 正文链接用品牌蓝 #0066ff → 深底上仅 4.12:1（WCAG AA 需 4.5）
     · 页脚正文 #444 / #666 → 2.04:1 / 3.46:1，肉眼几乎不可见
     · 导航/返回/页脚链接触控高度 17~30px（移动端最佳实践 44px）
   本文件为唯一来源：改这里即全站生效（生成器只需内联本 link）。
   ============================================================ */

/* ---------- 1. 正文字号下限 0.8rem（15px 基准 = 12px） ---------- */
.article-meta-tag,
.search-overlay .result-item .r-meta span,
.faq-header .badge,
.faq-date,
.blog-card-meta,
.blog-card-tag,
.news-badge,
.news-item .news-meta,
.home-post-meta,
.form-foot,
.footer-legal { font-size: 0.8rem; }

/* ---------- 2. 文字对比度（深底 #050914 上 ≥4.5:1） ---------- */
.article-body a,
.blog-card-footer,
.faq-item-a a,
.faq-item-cta a,
a.back,
.footer-email a,
.svc-card .svc-tag,
.case-card .case-meta span,
.step .step-num { color: #4d94ff; }

.article-body a { border-bottom-color: rgba(77, 148, 255, 0.4); }
.article-body a:hover { border-bottom-color: #4d94ff; }

footer,
footer p { color: #a0a6c0; }
footer a { color: #4d94ff; }
footer a:hover { color: #7fb3ff; }
#current-year { color: inherit; }

.footer-legal,
.footer-legal a { color: #8b93ad; }

/* 文章里表示“风险/警告”的暗红在深底上只有 3:1 → 提亮 */
.article-body td[style*="b71c1c"],
.article-body span[style*="b71c1c"],
.article-body strong[style*="b71c1c"] { color: #ff8a80 !important; }

/* ---------- 3. 触控目标：移动端 ≥44px，桌面 ≥24px ---------- */
input[type="file"] { min-height: 44px; }

/* 3a. 页头 / 页脚 / 导航链接：**所有视口**都要 ≥44px 高。
   判据分层是「控件 44×44、页头页脚链接 44、正文行内 24」——页头页脚不受"桌面放宽到 24"影响。
   2026-10-09 全站彻查：桌面视口实测 nav-link 只有 40~42px（此前 44px 规则被关在 max-width:900px 里），
   博客/FAQ 模板更矮(40px) → 桌面端被判为触控目标不达标。 */
nav a,
header a,
footer a,
.brand-area,
.nav-link,
.footer-links a,
.footer-email a { display: inline-flex; align-items: center; min-height: 44px; }

/* 3b. 控件（搜索/语言开关/返回）在**所有视口**都要 44×44 —— 判据分层里控件不分桌面/移动。
   2026-10-09 彻查：桌面视口实测 search-btn 33×29、lang-btn 42×28。 */
.search-btn,
.lang-btn,
.article-back,
a.back { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }

/* 独占一行的链接（整段/整条列表项就是链接）本身要有可点的厚度；
   嵌在句子里的行内链接不受影响（:only-child 才生效）。
   ★ 2026-10-02 修正：必须用 padding-block 而不是 padding —— 原来写 `padding: 4px 0`
   会把按钮式链接（.cta a / .news-source 等有底色的 pill）的左右内边距清零，
   导致文字贴到按钮左右边框（用户截图投诉）。padding-block 只加竖向厚度，横向不受影响。 */
p > a:only-child,
li > a:only-child,
li > a:last-child,
div > a:only-child,
td > a:only-child { display: inline-block; padding-block: 4px; }

@media (max-width: 900px) {
  .nav-link,
  .lang-btn,
  .search-btn,
  .article-back,
  a.back,
  .brand,
  footer a,
  .footer-links a,
  .home-post-link,
  .rel-links a,
  .btn,
  .btn-sm { min-height: 44px; }

  .nav-link,
  .lang-btn,
  .search-btn,
  .article-back,
  a.back,
  .brand,
  .footer-links a,
  .rel-links a { display: inline-flex; align-items: center; }

  .lang-btn,
  .search-btn { min-width: 44px; justify-content: center; }

  footer a,
  nav a,
  header a { display: inline-flex; align-items: center; min-height: 44px; }

  p > a:only-child,
  li > a:only-child,
  li > a:last-child,
  div > a:only-child,
  td > a:only-child { padding-block: 13px; }

  .nav-link { min-width: 44px; justify-content: center; }

  footer p { line-height: 1.9; }

  /* 按钮式链接（有底色的 pill/CTA）必须保留自己的左右内边距，文字不得贴边。
     2026-10-02：上方 `padding-block` 已不再清零横向内边距，这里做兜底保证最小呼吸感。 */
  .cta a,
  .news-source,
  .btn,
  .btn-sm,
  a.btn-primary,
  a.btn-secondary,
  .card-cta a { padding-left: max(18px, 1.1em); padding-right: max(18px, 1.1em); }
}

/* ---------- 5. WebKit（iOS Safari 真引擎）专属修正 —— 2026-10-02 实测发现 ---------- */
/* 5a. 原生 <select> 在 WebKit 里不认 min-height（实测仅 27px，达不到 44px 触控标准）
   必须先用 appearance:none 关掉原生外观，再自己画一个下拉箭头。 */
@media (max-width: 900px) {
  .intake-form select {
    -webkit-appearance: none;
    appearance: none;
    min-height: 44px;
    padding: 10px 38px 10px 14px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23888fb1' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
  }
  /* 5b. 窄屏（iPhone 390/320）WebKit 不会像 Chromium 那样自动收缩行内块，
     实测 /faq/ 与 /news/ 顶部导航簇宽 414px > 视口 → 右侧语言开关被推出屏幕。
     让导航换成可换行布局即可（Chromium 视觉不变）。 */
  nav { flex-wrap: wrap; row-gap: 8px; }
  nav .nav-right,
  nav .nav-links { flex-wrap: wrap; row-gap: 6px; }
}

/* ---------- 8. 附件区（2026-10-09 移动端体检）：粘贴靶子 ≥44px、提示行 ≥12px ---------- */
.attach-prompt { display: flex; align-items: center; justify-content: center; min-height: 44px; }
.attach-zone .paste-hint { font-size: max(12.5px, 0.78rem); }
