* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
}

html, body {
    height: 100%;
    background: #f8f9fa;
    color: #333;
    line-height: 1.7;
}

body {
    display: flex;
    flex-direction: column;
}

/* 固定顶部导航 */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: #fa6118;
    color: #fff;
    padding: 14px 24px;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

header img {
    border-radius: 4px;
}

#toggleBtn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: none;
}

/* 宽屏居中留白 */
.wrapper {
    max-width: 1500px;
    width: 100%;
    margin: 70px auto 20px;
    flex: 1;
}

.container {
    display: flex;
    background: #fff;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    min-height: calc(100vh - 140px);
}

/* ======================== */
/* ✅ 侧边栏（支持无限滚动） */
/* ======================== */
.sidebar {
    width: 300px;
    background: #fff;
    border-right: 1px solid #eaecef;
    padding: 24px;
    flex-shrink: 0;
    position: relative;
    height: calc(100vh - 70px);
    overflow-y: auto;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #fa6118;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

.menu-list {
    list-style: none;
}

.menu-item {
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    color: #444;
    font-size: 14px;
    line-height: 1.5;
    white-space: normal;
    word-break: break-word;
}

.menu-item:hover {
    background: #fff1e8;
    color: #fa6118;
}

.menu-item.active {
    background: #fa6118;
    color: #fff;
}

.menu-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* 内容区 */
.content {
    flex: 1;
    padding: 40px 50px;
    font-size: 16px;
    color: #333;
    min-width: 0;
}

.content h1 {
    font-size: 28px;
    color: #222;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #fa6118;
}

.content h2 {
    font-size: 22px;
    color: #222;
    margin: 32px 0 16px;
    font-weight: 600;
}

.content p {
    margin-bottom: 16px;
    color: #444;
}

.content ul {
    margin: 16px 0 16px 24px;
}

.content li {
    margin-bottom: 8px;
}

.content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.content a {
    color: #fa6118;
    text-decoration: none;
    font-weight: 500;
}
.content a:hover {
    text-decoration: underline;
}

/* 行内代码 */
.content code {
    background: #fff1e8;
    color: #c45510;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.95em;
}

/* 多行代码块 */
.content pre {
    background: #fdf5ef;
    border: 1px solid #f9c7a8;
    border-radius: 8px;
    padding: 20px;
    margin: 24px 0;
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.content pre code {
    background: none;
    color: #333;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre;
    display: block;
}

/* ============================== */
/* 手机端：抽屉式菜单 + 正常滚动 */
/* ============================== */
@media (max-width: 768px) {
    #toggleBtn { display: block; }

    .sidebar {
        width: 0;
        padding: 0;
        border: none;
        overflow: hidden;
        transition: 0.3s;
        position: fixed;
        top: 60px;
        left: 0;
        bottom: 0;
        z-index: 998;
        background: white;
        box-shadow: 2px 0 8px rgba(0,0,0,0.1);
        height: calc(100vh - 60px);
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar.open {
        width: 280px !important;
        padding: 20px;
        border-right: 1px solid #eee;
    }

    .content {
        padding: 24px;
        width: 100%;
    }

    .container {
        display: block;
        width: 100%;
    }
}

/* 底部 */
footer {
    background: #2d2d2d;
    color: #aaa;
    text-align: center;
    padding: 16px;
    font-size: 14px;
}