/* 公共样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Roboto, sans-serif;
    line-height: 1.75;
    margin: 0;
    padding: 0px;
    background-color: #fff;
    color: #2f3440;
    overflow-x: hidden;
}

/* 6. 添加内容容器约束 */
.content-container {
    max-width: 1200px;
    margin: 0 auto;
}
table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5rem 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    table-layout: auto;
}

th, td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

th {
    background-color: #4CAF50;
    color: white;
    font-weight: 600;
    text-align: center;  /* 表头居中 */
    position: sticky;
    top: 0;
}
td {
    vertical-align: top; /* 单元格顶部对齐 */
}
tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* 1. 增加基线对齐和字体平滑 */
html {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
}
a {
    color: #1572e8;
    text-decoration: none !important;
}
/* 2. 优化标题层次间距 */
h1 {
    margin: 2rem 0 0.5rem; /* 增加上边距 */
    font-size: 2.5rem;
    line-height: 1.3;
}
h2 {
    margin: 2rem 0 0.8rem; /* 增加顶部间距和减少底部间距 */
    font-size: 2rem;
    border-bottom: 1px solid rgb(234, 236, 239) /* 添加下边框作为下划线 */;
    scroll-margin-top: 30px;
    line-height: 1.38;

}
h3 {
    margin: 1.8rem 0 0.5rem; /* 增加顶部间距和减少底部间距 */
    font-size: 1.5rem;
    line-height: 1.42;
}

h4 {
    margin: 1.5rem 0 0.3rem; /* 增加顶部间距和减少底部间距 */
    font-size: 1.2rem;
    line-height: 1.45;
}

tr:hover {
    background-color: #e9ecef;
}
code {
    background-color: #e9ecef;
    padding: 2px 2px; /* 增加内边距 */
    border-radius: 4px; /* 圆角边框 */
    font-family: 'Courier New', Courier, monospace; /* 使用等宽字体 */
    font-size: 0.95em; /* 字体大小 */
    color: #333; /* 字体颜色 */
    display: inline; /* 使 code 元素更适合行内显示 */
    overflow-wrap: anywhere;
}
pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    overflow: auto;
    border: 1px solid #dee2e6;
    line-height: 1.5;
    font-size: 0.95rem;
    position: relative;
    counter-reset: line;
    max-width: 100%;
    white-space: pre;
}

strong {
    color: #000; /* 保持文本颜色为黑色 */
}
pre code
{
    background: none; /* 清除 <code> 元素的背景 */

}
/* 3. 优化列表样式 */
ul {
    padding-left: 1.5em; /* 调整列表缩进 */
    margin: 1rem 0; /* 增加列表上下间距 */
    list-style-type: none; /* 去掉默认列表样式 */
}
ul li {
    position: relative; /* 为每个li创建一个相对定位 */
    padding-left: 1.5em; /* 给每个li增加左内边距 */
    margin-bottom: 0.5rem; /* 列表项之间的间距 */
}
ul li::before {
    content: '•';  /* 自定义项目符号 */
    color: #4CAF50; /* 项目符号颜色 */
    font-size: 1.5em; /* 自定义项目符号的大小 */
    margin-right: 1.05rem;
    left: 0; /* 项目符号位置 */
}

/* 3. 优化列表样式 */
ol {
    padding-left: 2em; /* 增加列表缩进，使其更明显 */
    margin: 1.5rem 0; /* 增加列表上下间距，更好地分隔与其他内容 */
    line-height: 1.6; /* 增加行高，提升阅读体验 */
    font-family: Arial, sans-serif; /* 设置更易读的字体 */
}

ol li {
    margin-bottom: 0.75rem; /* 增加列表项之间的间距，避免视觉拥挤 */
    padding-left: 0.1em; /* 给每个列表项增加左内边距，使内容与边框有距离 */
    position: relative; /* 为伪元素创造定位环境 */
}

ol li::marker {
    font-weight: bold; /* 加粗列表项编号，提高可读性 */
}

li{
    margin-top:0.5rem; /* 列表项之间的间距 */
    margin-bottom:0.5rem; /* 列表项之间的间距 */
}

p{
    font-size: 1.1em;
    margin: 0.85rem 0;
    overflow-wrap: anywhere;
}

li{
    overflow-wrap: anywhere;
}

img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

hr {
    margin: 1.6rem 0;
}

footer {
    text-align: center;     /* 文字居中对齐 */
    position: static;     /* 定位 */
    bottom: 0;              /* 贴近底部 */
    width: 100%;            /* 宽度100% */
}

footer p {
    margin: 0;              /* 去掉段落的默认外边距 */
    font-size: 16px;        /* 设置字体大小 */
}


/* PC端样式 */
@media (min-width: 769px) {
    body {
        padding: 0rem 3rem;
    }
}

/* 移动端样式 */
@media (max-width: 768px) {
    body {
        padding: 1rem 0.9rem 1.5rem;
        line-height: 1.8;
    }

    h1 { font-size: 1.75rem; }  /* 压缩标题大小 */
    h2 { font-size: 1.45rem; }  /* 压缩标题大小 */
    h3 { font-size: 1.2rem; }  /* 压缩标题大小 */
    h4 { font-size: 1.05rem; }   /* 压缩标题大小 */

    p, li {
        font-size: 1.02rem; /* 缩小段落和列表项的字体大小 */
        line-height: 1.8;
        margin-bottom: 0.75rem;
    }

    h1,
    h2,
    h3,
    h4 {
        word-break: break-word;
    }

    table {
        display: block;
        overflow-x: auto;
        font-size: 0.92rem; /* 实际上缩小表格字体 */
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    th, td {
        padding: 8px 10px;    /* 减小单元格内边距 */
        min-width: 80px;  /* 增加最小宽度以适应更小的屏幕 */
    }

    pre {
        padding: 0.85rem;  /* 减小预格式化文本内边距 */
        font-size: 0.82rem; /* 缩小预格式化文本大小 */
        line-height: 1.65;
        border-radius: 10px;
    }

    code {
        font-size: 0.92em; /* 缩小预格式化文本大小 */
 
    }
    /* 设置图片大小 */
    img {
        width: auto; /* 确保图片最大宽度适应父元素 */
        max-width: 100%;
        height: auto;    /* 保持比例 */
        display: block;
        margin: 1rem auto;
        border-radius: 10px;
    }

    ul {
        padding-left: 0.2em!important; /* 调整列表缩进 */
        margin: 1rem 0; /* 增加列表上下间距 */
        list-style-type: none; /* 去掉默认列表样式 */
    }
    ul li {
        position: relative; /* 为每个li创建一个相对定位 */
        padding-left: 1.15em; /* 给每个li增加左内边距 */
        margin-bottom: 0.5rem; /* 列表项之间的间距 */
    }
    ul li::before {
        content: '•';  /* 自定义项目符号 */
        color: #4CAF50; /* 项目符号颜色 */
        font-size: 1.5em; /* 自定义项目符号的大小 */
        margin-right: 0.5rem;
        left: 0; /* 项目符号位置 */
    }

    ol {
        padding-left: 1.35rem;
        margin: 1rem 0;
    }

    img[style*="max-width: 50%"] {
        max-width: min(72vw, 320px) !important;
    }

    footer img {
        width: 16px !important;
        max-width: 16px !important;
        margin: 0 0.25rem 0 0;
        display: inline-block;
        vertical-align: middle;
    }

    footer {
        text-align: center;     /* 文字居中对齐 */
        position: static;     /* 定位 */
        bottom: 0;              /* 贴近底部 */
        width: 100%;            /* 宽度100% */
    }

    footer p {
        margin: 0;              /* 去掉段落的默认外边距 */
        font-size: 12px;        /* 设置字体大小 */
        line-height: 1.6;
    }
    
}
