/* CSS Reset - 确保跨浏览器一致性 */

/* 1. 使用更直观的盒模型 */
*, *::before, *::after {
    box-sizing: border-box;
}

/* 2. 移除默认边距 */
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
    margin: 0;
}

/* 3. 设置一致的列表样式 */
ul[role='list'], ol[role='list'] {
    list-style: none;
    padding: 0;
}

/* 4. 设置核心根值 */
html {
    scroll-behavior: smooth;
}

/* 5. 设置核心正文样式 */
body {
    min-height: 100vh;
    text-rendering: optimizeSpeed;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 6. 简化媒体元素 */
img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

/* 7. 移除表单元素的默认样式 */
input, button, textarea, select {
    font: inherit;
}

/* 8. 避免文本溢出 */
p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

/* 9. 创建根堆叠上下文 */
#root, #__next {
    isolation: isolate;
}

/* 10. 移除默认链接样式 */
a {
    text-decoration: none;
    color: inherit;
}

/* 11. 按钮重置 */
button {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

/* 12. 表格重置 */
table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* 13. 代码元素 */
code, pre {
    font-family: monospace;
}

/* 14. 字段集重置 */
fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

/* 15. 移除iOS输入阴影 */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    display: none;
}

/* 16. 平滑滚动锚点 */
@media (prefers-reduced-motion: no-preference) {
    :root {
        scroll-behavior: smooth;
    }
}

/* 17. 移除自动填充背景色 */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* 18. 隐藏视觉，但保持屏幕阅读器可访问性 */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* 19. 打印样式优化 */
@media print {
    *,
    *:before,
    *:after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }

    abbr[title]:after {
        content: " (" attr(title) ")";
    }

    /* 不显示需要用户交互的内容 */
    a[href^="#"]:after,
    a[href^="javascript:"]:after {
        content: "";
    }

    pre {
        white-space: pre-wrap !important;
    }

    pre,
    blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }
    
    tr,
    img {
        page-break-inside: avoid;
    }

    img {
        max-width: 100% !important;
    }

    h2,
    h3 {
        page-break-after: avoid;
    }

    thead {
        display: table-header-group;
    }
}