/* =========================================
   现代化 CSS Reset
   适用于 Nadella 的现代 Web 项目
   ========================================= */

/* 1. 盒模型：使用更直观的 border-box */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* 2. 移除默认外边距，防止移动端字体大小自动调整 */
* {
    margin: 0;
    padding: 0;
}

html {
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    /* 支持系统级深色/浅色模式，让原生滚动条和表单自动适配 */
    color-scheme: dark light;
}

/* 3. 基础排版与抗锯齿 */
body {
    min-height: 100vh;
    /* 使用系统字体栈，提升加载速度和原生体验 */
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 4. 标题文本平衡（现代 CSS 特性，防止标题换行时出现单个单词独占一行） */
h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
    line-height: 1.2;
}

/* 5. 段落文本优化（防止段落最后一行只有一个单词） */
p {
    text-wrap: pretty;
    overflow-wrap: break-word;
}

/* 6. 媒体元素默认响应式且块级显示，消除底部多余空白 */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

/* 7. 表单元素继承字体与颜色，移除浏览器默认丑陋样式 */
input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
    background: transparent;
    border: none;
}

button {
    cursor: pointer;
}

/* 移除 textarea 的默认水平拉伸，保留垂直拉伸 */
textarea {
    resize: vertical;
}

/* 8. 移除列表默认样式 */
ul, ol {
    list-style: none;
}

/* 9. 链接默认样式重置 */
a {
    color: inherit;
    text-decoration: none;
}

/* 10. 表格重置 */
table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* 11. 现代焦点样式（无障碍优化，仅键盘导航时显示 outline） */
:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* 12. 尊重用户的“减少动画”偏好（无障碍必备） */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 13. 隐藏未定义的自定义元素（Web Components 优化，防止闪烁） */
:not(:defined) {
    display: none;
}