﻿/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f5f5f5;
    line-height: 1.7;
}

/* ===== 城市切换栏（改为文档内嵌，非固定） ===== */
.city-nav-bar {
    /* 移除固定定位 */
    position: static; /* 原: fixed */
    top: unset;
    left: unset;
    right: unset;
    z-index: unset;
    /* 保留样式 */
    background: linear-gradient(135deg, #2c5f8a 0%, #1a3f5c 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    height: 52px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    /* 宽度跟随父容器 */
    width: 100%;
    color: white;
}
/* ===== 主体布局 ===== */
.主页最大边界 {
    max-width: 1400px;
    margin: 0 auto;
    margin-top: 0px; /* 为固定顶栏留空 */
    display: flex;
    min-height: calc(100vh - 52px);
    background: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
}

/* ===== 左侧目录 ===== */
.目录 {
    width: 320px;
    min-width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #e0e6ed;
    padding: 20px 0 !important;
    position: sticky;
    top: 52px;
    height: calc(100vh - 52px);
    overflow-y: auto;
    flex-shrink: 0;
}

    /* 目录滚动条美化 */
    .目录::-webkit-scrollbar {
        width: 4px;
    }

    .目录::-webkit-scrollbar-track {
        background: #f0f0f0;
    }

    .目录::-webkit-scrollbar-thumb {
        background: #c0c8d0;
        border-radius: 2px;
    }

        .目录::-webkit-scrollbar-thumb:hover {
            background: #2c5f8a;
        }

/* 目录标题 */
.catalog-header {
    padding: 10px 16px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #2c5f8a;
    letter-spacing: 1px;
    border-bottom: 2px solid #e0e6ed;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .catalog-header::before {
        content: "≡";
        font-size: 16px;
    }

.目录 p {
    margin: 0;
    padding: 0;
}

    .目录 p a {
        display: block;
        padding: 8px 16px 8px 20px;
        color: #4a5568;
        text-decoration: none;
        font-size: 13px;
        line-height: 1.5;
        border-left: 3px solid transparent;
        transition: all 0.2s ease;
        word-break: break-all;
        position: relative;
    }

        .目录 p a:hover {
            background: #e8f0f8;
            color: #2c5f8a;
            border-left-color: #2c5f8a;
            padding-left: 22px;
        }

        .目录 p a.active-link {
            background: #d6e8f7;
            color: #1a3f5c;
            border-left-color: #2c5f8a;
            font-weight: 600;
        }

/* ===== 右侧内容区 ===== */
#zhuti {
    flex: 1;
    width: auto !important;
    float: none !important;
    padding: 30px 40px 60px;
    overflow-x: hidden;
    min-width: 0;
    height: 60%;
    padding: 20px 0 !important;
    position: sticky;
    top: 52px;
    height: calc(100vh - 52px);
    overflow-y: auto;
    flex-shrink: 0;
}

    #zhuti h1 {
        font-size: 22px;
        color: #1a3f5c;
        text-align: center;
        padding: 0 0 24px !important;
        border-bottom: 2px solid #e0e6ed;
        margin-bottom: 30px;
    }

    /* ===== 内容区各级标题与段落 ===== */
    #zhuti > div {
        margin-bottom: 40px;
        padding-bottom: 30px;
        border-bottom: 1px dashed #dde3ea;
    }

        #zhuti > div:last-child {
            border-bottom: none;
        }

    /* h2 - 章节标题 */
    #zhuti h2 {
        font-size: 17px;
        color: #1a3f5c;
        background: linear-gradient(to right, #e8f0f8, #f8fafc);
        border-left: 4px solid #2c5f8a;
        padding: 10px 16px;
        margin-bottom: 18px;
        border-radius: 0 6px 6px 0;
    }

        #zhuti h2 a {
            color: #1a3f5c;
            text-decoration: none;
            transition: color 0.2s;
        }

            #zhuti h2 a:hover {
                color: #2c7bb6;
                text-decoration: underline;
            }

    /* h3 */
    #zhuti h3 {
        font-size: 15px;
        color: #555;
        margin: 16px 0 10px;
    }

    /* h4 - 问题标题 */
    #zhuti h4 {
        font-size: 14px;
        color: #2c5f8a;
        background: #f0f6fc;
        padding: 8px 12px;
        margin: 14px 0 6px;
        border-radius: 4px;
        border-left: 3px solid #5a9fd4;
        font-weight: 600;
        line-height: 1.6;
    }

    /* p - 答复内容 */
    #zhuti p,
    #zhuti p4 {
        display: block;
        color: #444;
        padding: 6px 12px 6px 16px;
        margin-bottom: 4px;
        border-left: 2px solid #e0e6ed;
        background: #fafcfe;
        border-radius: 0 4px 4px 0;
        line-height: 1.8;
    }

/* 勘误内容特殊样式 */
.redbj {
    background: #fff3cd;
    color: #7d4e00;
    padding: 5px 10px;
    border-radius: 4px;
    border-left: 3px solid #ffc107;
    display: block;
    font-size: 13px;
}

/* hr 分隔线 */
#zhuti hr {
    border: none;
    border-top: 1px solid #e0e6ed;
    margin: 30px 0;
}

/* ===== 回到顶部按钮 ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 42px;
    height: 42px;
    background: #2c5f8a;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(44, 95, 138, 0.4);
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 999;
    text-decoration: none;
}

    .back-to-top.visible {
        opacity: 1;
        pointer-events: auto;
    }

    .back-to-top:hover {
        background: #1a3f5c;
        transform: translateY(-3px);
        box-shadow: 0 5px 14px rgba(44, 95, 138, 0.5);
    }

/* ===== 锚点定位补偿（防止被固定顶栏遮挡） ===== */
[name], [id] {
    scroll-margin-top: 68px;
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
    .主页最大边界 {
        flex-direction: column;
    }

    .目录 {
        width: 100%;
        min-width: unset;
        position: static;
        height: auto;
        max-height: 220px;
        border-right: none;
        border-bottom: 1px solid #e0e6ed;
    }

    #zhuti {
        padding: 20px 16px 40px;
    }
}
