/* 基础重置和全局样式 */
@media screen and (max-width: 768px) {
    .sidebar-nav {
        transform: translateX(-100%);
        /* 其他小屏幕样式 */
    }
    
    .menu-toggle {
        display: block;
        /* 显示汉堡菜单按钮 */
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5; /* 整体灰色背景 */
    color: #333;
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
}

/* 导航栏样式 - 使用固定定位，不遮挡正文 */
.sidebar-nav {
    width: 15%;
    min-width: 220px;
    background-color: #2c3e50; /* 深灰色导航栏 */
    color: #ecf0f1;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.menu-toggle {
    display: none;
    padding: 15px;
    font-size: 24px;
    color: #ecf0f1;
    cursor: pointer;
    text-align: center;
    background-color: #34495e;
}

.menu-toggle:hover {
    background-color: #3d566e;
}

.nav-links {
    list-style-type: none;
    padding: 20px 0;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #bdc3c7; /* 灰色链接文字 */
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.nav-link i {
    margin-right: 12px;
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-link span {
    font-size: 16px;
}

.nav-link:hover {
    background-color: #34495e;
    color: #ecf0f1;
    border-left-color: #3498db;
}

.nav-link-current {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgb(82, 82, 255); /* 灰色链接文字 */
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.nav-link-current i {
    margin-right: 12px;
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-link-current span {
    font-size: 16px;
}

.nav-link-current:hover {
    background-color: #34495e;
    color: #00ccff;
    border-left-color: #3498db;
}

/* 主内容区域 - 使用margin-left为导航栏留出空间 */
.main-content {
    flex: 1;
    margin-left: 30%;
    padding: 30px;
    background-color: #ffffff;
    min-height: 100vh;
    width: calc(100% - 30%);
}

.content-container {
    max-width: 1200px;
    margin: 0 auto;
}

.page-title {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #3498db;
}

.section-title {
    font-size: 1.8rem;
    color: #34495e;
    margin: 30px 0 15px;
}

.content-section {
    margin: 30px 0;
}

.content-paragraph {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #666; /* 灰色正文文字 */
    margin-bottom: 20px;
    text-align: justify;
}

.code-example {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    margin: 40px 0;
    border-left: 5px solid #3498db;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.code-title {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

.code-description {
    font-size: 15px;
    color: #354a60;
    margin-bottom: 4px;
}

.code-description-error {
    font-size: 15px;
    color: red;
    margin-bottom: 4px;
    font-family: 'Courier New';
}

.code-container {
    background-color: #2c3e50;
    border-radius: 6px;
    padding: 20px;
    overflow-x: auto;
    margin-bottom: 15px;
}

.code-container pre {
    margin: 0;
}

.code-container code {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    color: #ffffff;
    line-height: 1.5;
}

.code-container p {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    color: #9e9e9e;
    line-height: 1.5;
}

/* 响应式设计 - 移动端 */
@media screen and (max-width: 700px) {
    .sidebar-nav {
        width: 100%;
        height: auto;
        min-height: auto;
        position: fixed;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar-nav.active {
        transform: translateX(0);
    }
    
    .menu-toggle {
        display: block;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 1001;
        background-color: #3498db;
        border-radius: 4px;
        padding: 10px 15px;
    }
    
    .nav-links {
        padding-top: 60px;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
        padding-top: 70px;
        width: 100%;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .content-paragraph {
        font-size: 1rem;
    }
}

/* 平板设备适配 */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .sidebar-nav {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
        width: calc(100% - 200px);
    }
    
    .page-title {
        font-size: 2.2rem;
    }
}
