* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", sans-serif;
}

ul,
li {
    list-style: none;
}

a {
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

a:hover {
    color: #c22422;
    text-decoration: underline;
}

.container {
    width: 1200px;
    margin: 0 auto;
}

body {
    line-height: 1.8;
    color: #333;
    background: #f9f9f9;
}

/* 面包屑 */
.breadcrumb {
    height: 40px;
    line-height: 40px;
    background: #f5f5f5;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.update-alert {
    background: #e3f2fd;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    color: #1565c0;
    margin: 15px 0;
    border: 1px solid #bbdefb;
}

.update-alert strong {
    color: #1976d2;
}

/* 头部样式（和全站统一） */
header {
    background: #1a1a1a;
    height: 80px;
    line-height: 80px;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.logo {
    float: left;
    color: #c22422;
    font-size: 28px;
    font-weight: bold;
}

nav {
    float: right;
}

nav ul li {
    float: left;
    margin-left: 30px;
}

nav ul li a {
    color: #fff;
    font-size: 16px;
}

nav ul li a.active {
    color: #c22422;
    font-weight: bold;
}

.search-box {
    float: right;
    margin: 20px 0 0 30px;
}

.search-box input {
    width: 200px;
    height: 40px;
    padding: 0 10px;
    border: none;
    border-radius: 4px 0 0 4px;
    float: left;
    outline: none;
}

.search-box button {
    width: 60px;
    height: 40px;
    background: #c22422;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    float: left;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: #a81e1e;
}

/* 内容页布局 */
.article-wrap {
    display: flex;
    gap: 20px;
    margin: 30px 0;
}

/* 主内容区 */
.article-main {
    flex: 1;
    background: #fff;
    border-radius: 6px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 文章头部 */
.article-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.article-title {
    font-size: 28px;
    line-height: 1.5;
    color: #1a1a1a;
    margin-bottom: 15px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: #666;
    align-items: center;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-meta .tag {
    background: #fef0f0;
    color: #c22422;
    padding: 2px 8px;
    border-radius: 3px;
}

.article-meta .cate a {
    color: #c22422;
}

/* 文章封面图：固定宽高比 优化CLS */
.article-cover {
    width: 100%;
    aspect-ratio: 1200/630;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 30px;
}

.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 正文样式：语义化排版 提升可读性 必应看重用户体验 */
.article-content {
    font-size: 16px;
    color: #333;
    line-height: 1.8;
}

.article-content h2 {
    font-size: 22px;
    color: #1a1a1a;
    margin: 30px 0 15px;
    padding-left: 10px;
    border-left: 4px solid #c22422;
}

.article-content h3 {
    font-size: 18px;
    color: #1a1a1a;
    margin: 20px 0 10px;
}

.article-content p {
    margin-bottom: 15px;
    text-indent: 2em;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 15px auto;
    display: block;
    cursor: pointer;
    transition: transform 0.3s;
}

.article-content img:hover {
    transform: scale(1.02);
}

.article-content ul,
.article-content ol {
    margin: 15px 0;
    padding-left: 2em;
}

.article-content ul li,
.article-content ol li {
    margin-bottom: 8px;
    list-style: disc;
}

.article-content strong {
    color: #c22422;
    font-weight: bold;
}

.article-content .tip {
    background: #fff8e6;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #ff9800;
    margin: 20px 0;
}

/* 文章底部信息 */
.article-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.article-tags {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.article-tags a {
    padding: 6px 15px;
    background: #f5f5f5;
    border-radius: 20px;
    font-size: 14px;
}

.article-tags a:hover {
    background: #c22422;
    color: #fff;
}

.original-declare {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    border: 1px solid #e9ecef;
}

.original-declare strong {
    color: #c22422;
}

/* 上一篇下一篇导航 */
.article-nav {
    display: flex;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.article-nav a {
    flex: 1;
    padding: 15px 20px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.article-nav a:hover {
    background: #fef0f0;
    color: #c22422;
}

.article-nav .prev {
    justify-content: flex-start;
}

.article-nav .next {
    justify-content: flex-end;
    text-align: right;
}

/* FAQ板块：对应结构化数据 必应触发问答摘要 */
.faq-box {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.faq-box h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.faq-item {
    margin-bottom: 15px;
}

.faq-q {
    font-weight: bold;
    color: #1a1a1a;
    margin-bottom: 8px;
    padding-left: 25px;
    position: relative;
}

.faq-q::before {
    content: "Q";
    position: absolute;
    left: 0;
    top: 2px;
    width: 18px;
    height: 18px;
    background: #c22422;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 12px;
}

.faq-a {
    padding-left: 25px;
    position: relative;
    color: #666;
}

.faq-a::before {
    content: "A";
    position: absolute;
    left: 0;
    top: 2px;
    width: 18px;
    height: 18px;
    background: #1976d2;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 12px;
}

/* 侧边栏 */
.article-sidebar {
    width: 300px;
}

.sidebar-box {
    background: #fff;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.sidebar-title {
    font-size: 18px;
    color: #c22422;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.related-list li {
    height: 36px;
    line-height: 36px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-left: 15px;
    position: relative;
    font-size: 14px;
}

.related-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    width: 6px;
    height: 6px;
    background: #c22422;
    border-radius: 50%;
}

.related-list li span {
    float: right;
    color: #999;
    font-size: 12px;
}

/* 固定目录（PC端滚动固定，提升用户体验） */
.toc-box {
    position: sticky;
    top: 100px;
}

.toc-list li {
    padding: 5px 0;
    padding-left: 15px;
    position: relative;
    font-size: 14px;
    border-left: 2px solid #eee;
}

.toc-list li.active {
    border-left-color: #c22422;
}

.toc-list li.active a {
    color: #c22422;
    font-weight: bold;
}

.toc-list li a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 友链区块 */
.friend-link {
    background: #f8f8f8;
    padding: 20px 0;
    margin-bottom: 30px;
}

.friend-link .block-title {
    font-size: 16px;
    margin-bottom: 15px;
    border-left: 4px solid #c22422;
    padding-left: 10px;
}

.link-list a {
    font-size: 14px;
    margin-right: 20px;
    line-height: 28px;
    display: inline-block;
}

/* 底部版权 */
footer {
    background: #1a1a1a;
    color: #999;
    padding: 30px 0;
    text-align: center;
    font-size: 14px;
    line-height: 24px;
}

footer a {
    color: #999;
    margin: 0 8px;
}

footer a:hover {
    color: #c22422;
}

.disclaimer {
    margin: 10px 0;
    font-size: 12px;
    max-width: 800px;
    margin: 10px auto;
    color: #777;
}

.icp {
    margin-top: 10px;
}

/* 回到顶部按钮 */
.back-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #c22422;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 50px;
    cursor: pointer;
    display: none;
    z-index: 998;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.back-top:hover {
    background: #a81e1e;
}

/* 响应式适配（必应移动优先索引，完美适配移动端） */
@media (max-width: 1200px) {
    .container {
        width: 100%;
        padding: 0 15px;
    }

    .article-wrap {
        flex-direction: column;
    }

    .article-sidebar {
        width: 100%;
    }

    .toc-box {
        position: static;
    }
}

@media (max-width: 768px) {
    header {
        height: auto;
        line-height: normal;
        padding: 15px 0;
        position: static;
    }

    .logo {
        float: none;
        text-align: center;
        margin-bottom: 10px;
    }

    .search-box {
        float: none;
        margin: 0 auto 15px;
        display: flex;
        justify-content: center;
    }

    nav {
        float: none;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
    }

    nav ul {
        display: inline-block;
    }

    nav ul li {
        float: none;
        display: inline-block;
        margin: 0 12px;
    }

    .article-main {
        padding: 20px;
    }

    .article-title {
        font-size: 22px;
    }

    .article-meta {
        gap: 10px;
        font-size: 13px;
    }

    .article-content {
        font-size: 15px;
    }

    .article-nav {
        flex-direction: column;
        gap: 10px;
    }

    .back-top {
        right: 15px;
        bottom: 15px;
        width: 45px;
        height: 45px;
        line-height: 45px;
    }
}