/* =========================================================
   Apple-style polish layer — CSS-only, zero-risk.
   纯 CSS 细节打磨：字体平滑、排版均衡、可访问焦点、平滑滚动、
   流畅交互过渡。不隐藏任何内容，无 JS 依赖，对爬虫/无障碍完全安全。
   ========================================================= */

/* 字体平滑 + 易读性（苹果同款渲染质感） */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 标题断行更均衡、段落收尾不留孤字（现代浏览器，旧版自动忽略） */
h1, h2, h3 { text-wrap: balance; }
p, li, figcaption, blockquote { text-wrap: pretty; }

/* 可访问的键盘焦点环（仅键盘导航时出现，不影响鼠标观感） */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: no-preference) {
  /* 锚点跳转平滑滚动 */
  html:focus-within { scroll-behavior: smooth; }

  /* 流畅的交互过渡（让既有 hover 效果更顺滑；只定义过渡时长，
     不改变任何最终样式，因此不会影响现有视觉设计） */
  a, button, summary,
  input, select, textarea {
    transition:
      color .2s ease,
      background-color .2s ease,
      border-color .2s ease,
      box-shadow .25s ease,
      transform .2s ease,
      opacity .2s ease;
  }
}
