* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
}

.header h1 {
    color: #333;
    font-size: 1.5rem;
}



.main {
    display: flex;
    flex: 1;
}

.sidebar {
    width: 300px;
    background-color: #fff;
    border-right: 1px solid #eaeaea;
    padding: 1rem;
    height: calc(100vh - 60px);
    overflow-y: auto;
    position: sticky;
    top: 60px;
}

.content {
    flex: 1;
    padding: 2rem;
    background-color: #fff;
    min-height: calc(100vh - 60px);
}

.menu-item {
    margin-bottom: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.menu-item:hover {
    background-color: #f8f9fa;
}

.menu-title {
    font-weight: bold;
    padding: 0.7rem 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    position: relative;
}

.menu-title:hover {
    background-color: #e9ecef;
}

.menu-title::before {
    content: "▶";
    display: inline-block;
    margin-right: 12px;
    font-size: 0.8em;
    transition: transform 0.2s ease;
    color: #495057;
    width: 12px;
    text-align: center;
}

.menu-item.has-children.active .menu-title::before {
    transform: rotate(90deg);
}

.menu-title::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #3498db;
    border-radius: 0 2px 2px 0;
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.menu-item.active .menu-title::after {
    transform: scaleY(1);
}

.submenu {
    padding-left: 1.8rem;
    display: none;
    position: relative;
}

.submenu::before {
    content: "";
    position: absolute;
    left: 1.2rem;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #e9ecef;
}

.submenu-item {
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    margin: 0.2rem 0;
    position: relative;
}

.submenu-item:hover {
    background-color: #f8f9fa;
}



.submenu-item::after {
    content: "";
    position: absolute;
    left: -1.2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #ced4da;
}

.has-children .submenu {
    display: none;
}

.has-children.active .submenu {
    display: block;
}

.content h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
}


.content h2 {
    font-size: 1.4rem;
    margin: 1.5rem 0 1rem 0;
    color: #34495e;
    display: flex;
    align-items: center;
}


.content p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.content img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

.content .image-container {
    text-align: center;
    margin: 1.5rem 0;
}



.content .image-caption {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

/* 添加图标字体支持 */
.menu-title::before,
.submenu-item::before,
.header::before,
.content h1::before,
.content h2::before,
.content .image-container::before {
    font-family: 'Segoe UI Emoji', 'Segoe UI Symbol', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

/* 添加额外的视觉增强样式 */
.content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.content li strong {
    color: #2c3e50;
}

/* 提示框样式 */
.content > div[style*="background-color"] {
    margin: 1.5rem 0;
    border-radius: 8px;
    padding: 1rem;
}

/* 添加内容加载样式 */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.loading p {
    font-size: 1.2rem;
}

.error {
    text-align: center;
    padding: 2rem;
    color: #e74c3c;
    background-color: #fdf2f2;
    border-radius: 4px;
    margin: 1rem;
}

.error p {
    font-size: 1.1rem;
}

/* 代码块样式 */
code {
    background-color: #f1f1f1;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* 链接样式 */
a {
    color: #3498db;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* 响应式改进 */
@media (max-width: 768px) {
    .main {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid #eaeaea;
    }
    
    .header h1 {
        font-size: 1.3rem;
    }
    
    .content {
        padding: 1rem;
    }
    
    .menu-title {
        padding: 0.6rem 0.4rem;
        font-size: 0.95rem;
    }
    
    .submenu-item {
        padding: 0.4rem;
        font-size: 0.9rem;
    }
    
    .content h1 {
        font-size: 1.5rem;
    }
    
    .content h2 {
        font-size: 1.2rem;
    }
}