/* --- 全局复位 --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    width: 100%; max-width: 100vw; overflow-x: hidden;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    color: #333; line-height: 1.8; background-color: #f9fafb;
    padding-top: 70px; 
}
.container { width: 95%; max-width: 1200px; margin: 0 auto; }

/* 默认隐藏侧边栏的汉堡按钮和遮罩 */
.sidebar-header { display: none; }
.sidebar-overlay { display: none; }

/* --- 顶部导航栏 --- */
.navbar {
    position: fixed; top: 0; left: 0; width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px); z-index: 1000;
    border-bottom: 1px solid #e5e7eb; height: 56px;
}
.navbar-container { display: flex; justify-content: space-between; align-items: center; height: 100%; }
.logo { font-size: 1.2rem; font-weight: 700; color: #2563eb; text-decoration: none; white-space: nowrap; }
.nav-links { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.nav-links a { text-decoration: none; color: #1f2937; font-weight: 500; font-size: 0.9rem; transition: all 0.3s ease; white-space: nowrap; }
.nav-links a:hover { color: #2563eb; }

/* --- 教程页布局：左右分栏 --- */
.main-container { display: flex; gap: 20px; align-items: flex-start; padding-bottom: 40px; }

/* 左侧菜单 (电脑端) */
.sidebar {
    width: 260px; flex-shrink: 0; background-color: #fff;
    border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    padding: 15px; position: sticky; top: 80px; overflow: hidden;
}
.sidebar-menu { display: flex; flex-direction: column; gap: 8px; }
.sidebar-menu a {
    display: flex; align-items: center; gap: 12px;
    text-decoration: none; color: #4b5563; padding: 12px 15px;
    border-radius: 8px; font-size: 0.95rem; transition: all 0.3s; font-weight: 500;
}
.sidebar-menu a i { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar-menu a:hover { background-color: #f3f4f6; color: #2563eb; }
.sidebar-menu a.active { background-color: #eff6ff; color: #2563eb; font-weight: 600; border-left: 4px solid #2563eb; }
.sidebar-menu .download-link { margin-top: 15px; background-color: #2563eb; color: #fff; }
.sidebar-menu .download-link:hover { background-color: #1d4ed8; color: #fff; }

/* 右侧内容 */
.content { flex-grow: 1; min-width: 0; }
.content-page { display: none; }
.content-page.active { display: block; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* 内容卡片 */
.card { background-color: #fff; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); padding: 30px; }
.card h2 { font-size: 1.5rem; color: #1f2937; margin-bottom: 20px; border-bottom: 2px solid #f3f4f6; padding-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.card h2 i { color: #3b82f6; }
.card p { font-size: 1rem; color: #4b5563; margin-bottom: 15px; }
.highlight-text { background-color: #fffbeb; color: #b45309; padding: 10px 15px; border-left: 4px solid #f59e0b; border-radius: 4px; }
.card img { max-width: 100%; height: auto; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); margin: 15px 0 25px; display: block; }
.divider { border: none; border-top: 1px dashed #e5e7eb; margin: 30px 0; }

/* ========================================================
   响应式核心：手机端变为"缩小边缘停靠"图标菜单
======================================================== */
@media (max-width: 768px) {
    .logo { font-size: 1.1rem; }
    .nav-links { gap: 0.8rem; }
    .nav-links a { font-size: 0.85rem; }

    /* 让整个容器贴边，不留大缝隙 */
    .container.main-container { width: 100%; margin: 0; gap: 0; display: block; padding-left: 60px; /* 留出 60px 给缩小的侧边栏 */ }

    /* 1. 左侧缩小的迷你侧边栏 */
    .sidebar {
        position: fixed;
        top: 56px;
        left: 0;
        width: 55px; /* 默认只剩下一条极窄的 55px，仅仅展示图标 */
        height: calc(100vh - 56px);
        border-radius: 0;
        padding: 0;
        z-index: 1000;
        transition: width 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.05);
        overflow-x: hidden;
    }

    /* 2. 点击展开后的状态 */
    .sidebar.open {
        width: 250px;
        box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    }

    /* 显示顶部汉堡包按钮 (折叠/展开开关) */
    .sidebar-header {
        display: block;
        text-align: center;
        padding: 15px 0;
        font-size: 1.2rem;
        color: #2563eb;
        cursor: pointer;
        background-color: #f3f4f6;
        border-bottom: 1px solid #e5e7eb;
    }

    .sidebar-menu a {
        padding: 15px 17px; /* 保证图标水平居中于那 55px */
        border-radius: 0;
        border-left: 3px solid transparent;
        white-space: nowrap; /* 文字不准换行 */
    }

    .sidebar-menu a.active {
        border-left: 3px solid #2563eb;
        background-color: #eff6ff;
    }

    /* 当菜单是迷你状态时，文字被隐藏 (因为 overflow: hidden 和定宽) */
    .sidebar-menu span {
        opacity: 0;
        transition: opacity 0.2s;
    }

    /* 展开时，显示文字 */
    .sidebar.open .sidebar-menu span {
        opacity: 1;
    }

    /* 特殊处理下载按钮，去背景色变成只显示蓝色图标 */
    .sidebar-menu .download-link { background-color: transparent; color: #2563eb; }
    .sidebar.open .sidebar-menu .download-link { background-color: #2563eb; color: #fff; border-radius: 8px; margin: 15px; padding: 12px; justify-content: center; }

    /* 右侧正文：填满剩余空间 */
    .content { padding: 15px; width: 100%; }
    .card { padding: 20px 15px; }

    /* 黑色半透明遮罩 */
    .sidebar-overlay {
        position: fixed; top: 56px; left: 0; width: 100vw; height: calc(100vh - 56px);
        background: rgba(0,0,0,0.5); z-index: 999; display: none; opacity: 0; transition: opacity 0.3s;
    }
    .sidebar-overlay.open { display: block; opacity: 1; }
}
/* ========================================================
   5. 页脚样式
======================================================== */
.site-footer {
    text-align: center;
    padding: 25px 15px;
    margin-top: 20px;
    color: #6b7280; /* 灰颜色，显得高级且不抢眼 */
    font-size: 0.9rem;
    border-top: 1px solid #e5e7eb; /* 顶部加一条浅色分割线 */
    width: 100%;
}
