* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto; /* 允许垂直滚动 */
    margin: 0;
    padding: 0;
}

/* 移动端：允许滚动 */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        height: auto !important;
        min-height: 100vh !important;
    }
    
    /* 移动端隐藏目录导航 */
    .tutorial-toc {
        display: none !important;
    }
    
    .tutorial-content-wrapper {
        display: block !important;
    }
    
    .tutorial-main {
        width: 100% !important;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* PC端：确保body和footer布局正确 */
@media (min-width: 769px) {
    html, body {
        height: auto !important;
        min-height: 100vh !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }
    
    body {
        display: flex !important;
        flex-direction: column !important;
        min-height: 100vh !important;
        position: relative !important;
    }
    
    .app-container {
        flex: 1 1 auto !important;
        display: flex !important;
        flex-direction: row !important;
        min-height: 100vh !important; /* footer已隐藏，不需要留出空间 */
        height: auto !important;
        max-height: none !important;
        position: relative !important;
    }
    
    .site-footer {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        height: 0 !important;
        padding: 0 !important;
        order: 999 !important;
        position: relative !important;
        width: 100% !important;
        clear: both !important;
    }
}

.app-container {
    display: flex;
    min-height: 100vh; /* footer已隐藏，不需要留出空间 */
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 30px 30px 30px 30px;
    position: relative;
    flex-direction: row; /* 确保横向布局 */
    align-items: stretch; /* 子元素拉伸填满高度 */
}

/* PC端：覆盖上面的规则 */
@media (min-width: 769px) {
    .app-container {
        min-height: 100vh !important; /* footer已隐藏，不需要留出空间 */
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
}

/* PC端：确保右侧内容区域没有多余的右边距 */
@media (min-width: 769px) {
    .app-container {
        padding: 30px 30px 30px 30px !important;
        min-height: 100vh !important; /* footer已隐藏，不需要留出空间 */
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: stretch !important;
    }
    
    .main-content {
        margin-right: 0 !important;
        padding-right: 1rem !important;
        max-width: 100% !important;
        width: 100% !important;
        height: 100% !important; /* 占满父容器高度 */
        min-height: calc(100vh - 60px) !important; /* 至少占满视口减去padding */
        max-height: calc(100vh - 60px) !important; /* 最大高度为视口减去padding */
        overflow-y: auto !important; /* 允许垂直滚动 */
        overflow-x: hidden !important; /* 防止水平滚动 */
        flex: 1 !important; /* flex布局中占据剩余空间 */
    }
    
    #tutorial-detail {
        margin-right: 0 !important;
        padding-right: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .tutorial-content-wrapper {
        display: flex !important;
        gap: 2rem;
        align-items: flex-start;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        min-height: 400px !important; /* 确保有足够的高度 */
    }
    
    .tutorial-main {
        flex: 1;
        min-width: 0;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        min-height: 400px !important; /* 确保有足够的高度 */
    }
    
    .tutorial-header {
        margin-right: 0 !important;
        padding-right: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .tutorial-body {
        margin-right: 0 !important;
        padding-right: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* PC端标题导航样式 */
    .tutorial-toc {
        position: sticky;
        top: 2rem;
        width: 250px;
        min-height: 100px;
        max-height: calc(100vh - 4rem);
        overflow-y: auto;
        overflow-x: hidden;
        background: transparent;
        border: none;
        border-left: 3px solid #3498db;
        border-radius: 0;
        padding: 1rem;
        padding-left: 1.5rem;
        padding-right: 0.5rem;
        flex-shrink: 0;
        display: block !important; /* 确保目录显示 */
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .toc-item.toc-empty {
        color: #999;
        cursor: default;
        font-style: italic;
    }
    
    .toc-item.toc-empty:hover {
        background: transparent;
        color: #999;
    }
    
    .toc-list {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .toc-item {
        padding: 0.5rem 0.75rem;
        cursor: pointer;
        color: #34495e;
        font-size: 0.9rem;
        border-radius: 4px;
        transition: all 0.2s;
        word-break: break-word;
    }
    
    .toc-item:hover {
        background: #e3f2fd;
        color: #1976d2;
    }
    
    .toc-item.active {
        background: #e3f2fd;
        color: #1976d2;
        font-weight: 600;
    }
}

/* 移动端：允许滚动 */
@media (max-width: 768px) {
    .app-container {
        height: auto !important;
        min-height: 100vh !important;
        overflow: visible !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
    }
}

/* 移动端：移除padding，确保页面全宽显示 */
@media (max-width: 768px) {
    .app-container {
        padding: 0 !important;
    }
}

/* 左侧目录区域 */
.sidebar {
    width: 300px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
    position: relative !important;
    left: auto !important;
    visibility: visible;
    opacity: 1;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
}

.search-box {
    margin-top: 0.5rem;
}

.search-box input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: #3498db;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.categories-tree {
    padding: 0 0.5rem;
}

/* 目录项样式 - 简洁文字样式 */
.category-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    color: #333;
    font-size: 0.9rem;
    transition: background-color 0.2s;
    border-radius: 3px;
    margin: 0.1rem 0;
    user-select: none;
}

.category-item:hover {
    background-color: #f0f0f0;
}

.category-item.active {
    background-color: #e3f2fd;
    color: #1976d2;
    font-weight: 500;
}

.category-item.category-level1 {
    font-weight: 600;
    color: #2c3e50;
    padding: 0.75rem 0.75rem 0.5rem;
    margin-top: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-item.category-level1:hover {
    background-color: #f0f0f0;
}

.category-item.category-level1:first-child {
    margin-top: 0;
}

.category-item.category-level2 {
    padding-left: 1.5rem;
    color: #555;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-item.category-level2:hover {
    background-color: #f0f0f0;
}

.category-item.category-level3 {
    padding-left: 2.5rem;
    color: #666;
    font-size: 0.9rem;
    cursor: pointer;
}

/* 折叠图标 */
.collapse-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    text-align: center;
    font-size: 10px;
    color: #999;
    transition: color 0.2s;
}

/* 折叠容器 */
.collapsible-content {
    overflow: hidden;
}

.collapsible-content.collapsed {
    display: none;
}

/* 右侧内容区域 */
.main-content {
    flex: 1;
    background: #fff;
    overflow-y: auto;
    overflow-x: hidden !important; /* 防止水平滚动，内容超出时隐藏 */
    padding: 2rem;
    padding-right: 2rem;
    position: relative;
    min-width: 0; /* 防止flex子元素溢出 */
    visibility: visible;
    opacity: 1;
    display: flex;
    margin-right: 0;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    z-index: 1; /* 确保在正确的层级 */
    box-sizing: border-box; /* 确保padding包含在宽度内 */
    height: auto !important; /* 允许高度自适应内容 */
    min-height: 100% !important; /* 至少占满父容器 */
    max-height: none !important; /* 不限制最大高度 */
}

.tutorial-placeholder {
    text-align: center;
    padding: 4rem 2rem;
    color: #7f8c8d;
    font-size: 1.1rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: visible;
    opacity: 1;
    background: #fff;
}

/* 移动端：当有内容时，占位符应该隐藏 */
@media (max-width: 768px) {
    .tutorial-placeholder {
        display: none !important;
    }
    
    /* 只有当没有内容时才显示占位符 */
    .main-content:not(:has(#tutorial-detail[style*="display: block"])) .tutorial-placeholder {
        display: flex !important;
    }
}

.tutorial-placeholder p {
    margin: 0;
}

.tutorial-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
    margin-right: 0;
    padding-right: 0;
    width: 100%;
    max-width: 100%;
    position: relative;
    z-index: 1;
}

.tutorial-header h2 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.tutorial-meta {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.tutorial-body {
    line-height: 1.8;
    color: #34495e;
    margin-right: 0;
    padding-right: 0;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 400px !important; /* 确保有足够的最小高度 */
    display: block !important; /* 确保显示 */
    visibility: visible !important; /* 确保可见 */
    opacity: 1 !important; /* 确保不透明 */
    position: relative !important; /* 确保定位正常 */
    padding: 2rem 0 !important; /* 添加内边距 */
    margin-top: 0 !important;
    margin-bottom: 2rem !important;
    z-index: 2 !important; /* 确保在正确的层级 */
    top: 0 !important;
    left: 0 !important;
    background: transparent !important;
    box-sizing: border-box !important; /* 确保padding包含在宽度内 */
    overflow-wrap: break-word !important; /* 允许长单词换行 */
    word-wrap: break-word !important; /* 兼容旧浏览器 */
}

/* 保留所有内联样式，确保格式正确显示 */
.tutorial-body * {
    box-sizing: border-box;
}

/* 确保普通段落和文本颜色正常（不强制覆盖，只作为默认值） */
.tutorial-body > p:not([style*="color"]),
.tutorial-body > div:not([style*="color"]):not([class*="ql-"]) {
    color: #34495e;
    display: block !important; /* 确保显示 */
    visibility: visible !important; /* 确保可见 */
    opacity: 1 !important; /* 确保不透明 */
    position: relative !important; /* 确保定位正常 */
}

/* 确保标题颜色正常 */
.tutorial-body h1,
.tutorial-body h2,
.tutorial-body h3,
.tutorial-body h4,
.tutorial-body h5,
.tutorial-body h6 {
    color: #2c3e50;
}

/* 确保链接颜色正常 */
.tutorial-body a {
    color: #1976d2;
    text-decoration: none;
}

.tutorial-body a:hover {
    color: #1565c0;
    text-decoration: underline;
}

/* 修复可能的红色文本异常显示 */
.tutorial-body p[style*="color: red"],
.tutorial-body p[style*="color:#ff0000"],
.tutorial-body p[style*="color: #ff0000"],
.tutorial-body p[style*="color:red"],
.tutorial-body div[style*="color: red"],
.tutorial-body div[style*="color:#ff0000"],
.tutorial-body div[style*="color: #ff0000"],
.tutorial-body div[style*="color:red"],
.tutorial-body span[style*="color: red"],
.tutorial-body span[style*="color:#ff0000"],
.tutorial-body span[style*="color: #ff0000"],
.tutorial-body span[style*="color:red"] {
    color: #34495e !important;
}

.tutorial-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 1rem 0;
    display: block;
}

/* 支持文本对齐（左、中、右、两端对齐） */
.tutorial-body p,
.tutorial-body div,
.tutorial-body h1,
.tutorial-body h2,
.tutorial-body h3,
.tutorial-body h4,
.tutorial-body h5,
.tutorial-body h6 {
    margin-bottom: 1rem;
}

.tutorial-body p[style*="text-align: center"],
.tutorial-body div[style*="text-align: center"],
.tutorial-body p[style*="text-align:center"],
.tutorial-body div[style*="text-align:center"] {
    text-align: center !important;
}

.tutorial-body p[style*="text-align: right"],
.tutorial-body div[style*="text-align: right"],
.tutorial-body p[style*="text-align:right"],
.tutorial-body div[style*="text-align:right"] {
    text-align: right !important;
}

.tutorial-body p[style*="text-align: justify"],
.tutorial-body div[style*="text-align: justify"],
.tutorial-body p[style*="text-align:justify"],
.tutorial-body div[style*="text-align:justify"] {
    text-align: justify !important;
}

/* 支持文本缩进（段首空格）- 内联样式会自动保留 */
/* 支持Quill编辑器生成的各种格式 */
.tutorial-body .ql-align-center {
    text-align: center !important;
}

.tutorial-body .ql-align-right {
    text-align: right !important;
}

.tutorial-body .ql-align-justify {
    text-align: justify !important;
}

/* 支持列表格式 */
.tutorial-body ul,
.tutorial-body ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.tutorial-body li {
    margin-bottom: 0.5rem;
}

/* 支持代码块 */
.tutorial-body pre {
    background: #f4f4f4;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
}

.tutorial-body code {
    font-family: 'Courier New', monospace;
    background: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 2px;
}

.tutorial-body h1,
.tutorial-body h2,
.tutorial-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.error {
    color: #e74c3c;
    text-align: center;
    padding: 2rem;
}

.empty {
    color: #7f8c8d;
    text-align: center;
    padding: 2rem;
}

/* 分享按钮样式 */
.tutorial-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.share-btn:hover {
    background: #2980b9;
}

.share-btn svg {
    flex-shrink: 0;
}

/* 分享弹窗样式 */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.share-modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s;
    box-sizing: border-box;
    margin: 0 auto;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.share-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #2c3e50;
}

.share-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #7f8c8d;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.share-modal-close:hover {
    color: #2c3e50;
}

.share-modal-body {
    padding: 1.5rem;
}

.share-item {
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.share-item:last-child {
    margin-bottom: 0;
}

.share-item label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.share-text {
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 4px;
    color: #34495e;
    word-break: break-word;
}

.share-link-container {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.share-link-container input,
.share-link-container textarea {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: none;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.share-link-container textarea {
    min-height: 80px;
    padding-right: 0.75rem;
}

.copy-btn {
    padding: 0.75rem 1.5rem;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: #229954;
}

/* 复制成功提示 */
.copy-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #27ae60;
    color: white;
    padding: 1rem 2rem;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s;
    max-width: 90%;
    word-break: break-word;
}

.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 移动端：调整提示弹窗位置，确保在分享弹窗之上 */
@media (max-width: 768px) {
    .copy-toast {
        bottom: 1rem !important;
        z-index: 10001 !important;
        max-width: 85% !important;
        padding: 0.75rem 1.5rem !important;
        font-size: 0.9rem !important;
    }
}

/* 一级目录内容显示 */
.level1-content-wrapper {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    visibility: visible;
    opacity: 1;
}

.level1-content {
    flex: 1;
    text-align: center;
    padding: 4rem 2rem;
    color: #34495e;
    font-size: 1.1rem;
    line-height: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    visibility: visible;
    opacity: 1;
}

/* 移动端样式重置 - 放在这里确保优先级 */
@media (max-width: 768px) {
    .level1-content-wrapper {
        display: block !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        flex-direction: unset !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        top: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        align-items: unset !important;
        justify-content: unset !important;
    }
    
    .level1-content {
        display: block !important;
        flex: none !important;
        text-align: left !important;
        padding: 1rem !important;
        margin: 0 !important;
        align-items: unset !important;
        justify-content: unset !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        top: 0 !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
    }
}

.level1-content p {
    margin: 0;
}

.level1-first-tutorial {
    padding: 2rem;
    border-top: 2px solid #e0e0e0;
    text-align: center;
    background: #f8f9fa;
}

.first-tutorial-label {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.first-tutorial-link {
    display: inline-block;
    color: #3498db;
    font-size: 1.1rem;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid #3498db;
    border-radius: 4px;
    transition: all 0.3s;
}

.first-tutorial-link:hover {
    background: #3498db;
    color: white;
}

/* 下一篇教程链接 */
.tutorial-next {
    margin-top: 3rem;
    padding: 2rem;
    border-top: 2px solid #e0e0e0;
    text-align: center;
    background: #f8f9fa;
}

.next-tutorial-label {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.next-tutorial-link {
    display: inline-block;
    color: #3498db;
    font-size: 1.1rem;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid #3498db;
    border-radius: 4px;
    transition: all 0.3s;
}

.next-tutorial-link:hover {
    background: #3498db;
    color: white;
}
/* ============================================
   移动端响应式设计
   ============================================ */

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background 0.3s;
}

.mobile-menu-btn:hover {
    background: #2980b9;
}

.mobile-menu-btn svg {
    display: block;
}

/* 移动端遮罩层 */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-overlay.show {
    opacity: 1;
}

/* 侧边栏头部顶部 */
.sidebar-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.mobile-close-btn {
    display: none;
    background: none;
    border: none;
    color: #2c3e50;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    z-index: 1002;
    position: relative;
}

.mobile-close-btn:hover,
.mobile-close-btn:active {
    color: #3498db;
}

.mobile-close-btn svg {
    display: block;
    pointer-events: none;
}

/* 移动端样式（最大宽度768px） */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
    }
    
    .app-container {
        flex-direction: column;
        padding: 0;
        height: 100vh;
        position: relative;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* 显示移动端菜单按钮 */
    .mobile-menu-btn {
        display: block;
    }
    
    /* 显示移动端关闭按钮 */
    .mobile-close-btn {
        display: block;
    }
    
     /* 侧边栏在移动端 */
     .sidebar {
         position: fixed !important;
         top: 0 !important;
         left: -100% !important;
         width: 80% !important;
         max-width: 320px !important;
         height: 100vh !important;
         z-index: 1000 !important;
         transition: left 0.3s ease !important;
         box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2) !important;
         -webkit-overflow-scrolling: touch !important;
         overflow-y: auto !important;
         display: block !important;
         visibility: visible !important;
         opacity: 1 !important;
         background: #fff !important;
     }
     
     .sidebar.mobile-open {
         left: 0 !important;
         display: block !important;
         visibility: visible !important;
         opacity: 1 !important;
         z-index: 1000 !important;
     }
     
     /* 强制关闭状态（微信浏览器兼容） */
     .sidebar:not(.mobile-open) {
         left: -100% !important;
     }
     
     /* 确保侧边栏在遮罩层之上 */
     .sidebar.mobile-open {
         z-index: 1001 !important;
     }
     
     .mobile-overlay {
         z-index: 1000 !important;
     }
    
    /* 确保关闭按钮在移动端可见且可点击（微信浏览器兼容） */
    .mobile-close-btn {
        display: block !important;
        z-index: 1002 !important;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        touch-action: manipulation;
        min-width: 44px;
        min-height: 44px;
        pointer-events: auto !important;
        position: relative;
        background: transparent;
    }
    
    /* 确保遮罩层可点击 */
    .mobile-overlay {
        pointer-events: auto !important;
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
    }
    
    /* 确保侧边栏内容不会阻止点击 */
    .sidebar.mobile-open .sidebar-content {
        pointer-events: auto;
    }
    
    /* 确保遮罩层可点击 */
    .mobile-overlay {
        pointer-events: auto !important;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* 遮罩层 */
    .mobile-overlay {
        display: block;
    }
    
    .mobile-overlay.show {
        display: block;
    }
    
     /* 主内容区域 - 完全移除flex布局，确保内容从顶部开始 */
     .main-content {
         width: 100% !important;
         padding: 0 !important;
         margin: 0 !important;
         margin-top: 3.5rem !important; /* 为菜单按钮留出空间 */
         overflow-y: visible !important;
         -webkit-overflow-scrolling: touch !important;
         position: relative !important;
         height: auto !important;
         min-height: calc(100vh - 3.5rem) !important;
         display: block !important;
         flex: none !important;
         flex-direction: unset !important;
         align-items: unset !important;
         justify-content: unset !important;
         visibility: visible !important;
         opacity: 1 !important;
         background: #fff !important;
         z-index: 1 !important;
     }
    
     /* 确保主内容区域内的所有子元素都从顶部开始，并且全宽显示 */
     .main-content > * {
         margin-left: 0 !important;
         margin-right: 0 !important;
         padding-left: 1rem !important;
         padding-right: 1rem !important;
         box-sizing: border-box !important;
         width: 100% !important;
         max-width: 100% !important;
     }
     
     .main-content > *:first-child {
         margin-top: 0 !important;
         padding-top: 1rem !important;
     }
     
     /* 确保内容区域全宽 */
     #tutorial-detail,
     .tutorial-placeholder,
     .level1-content-wrapper {
         width: 100% !important;
         max-width: 100% !important;
         box-sizing: border-box !important;
         margin-left: 0 !important;
         margin-right: 0 !important;
     }
    
    #tutorial-detail {
        position: relative !important;
        top: 0 !important;
        width: 100% !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
        overflow: visible !important; /* 确保内容不被裁剪 */
        -webkit-overflow-scrolling: touch;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 1 !important;
        opacity: 1 !important;
        height: auto !important;
        min-height: auto !important;
        background: #fff !important;
    }
    
    /* 移动端：占位符默认隐藏，只有当没有内容时才显示 */
    .tutorial-placeholder {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    /* 确保主内容区域在移动端可见 */
    .main-content {
        background: #fff !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* 确保教程内容容器在移动端可见 */
    .tutorial-content-wrapper {
        display: flex !important;
        flex-direction: column !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        width: 100% !important;
    }
    
    .tutorial-main {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        width: 100% !important;
    }
    
    .level1-content-wrapper {
        min-height: auto !important;
        height: auto !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        display: block !important;
        flex-direction: unset !important;
        position: relative !important;
        top: 0 !important;
        align-items: unset !important;
        justify-content: unset !important;
    }
    
    .level1-content {
        padding: 1rem !important;
        min-height: auto !important;
        height: auto !important;
        display: block !important;
        flex: unset !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        text-align: left !important;
        position: relative !important;
        top: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    .level1-first-tutorial {
        margin-top: 1rem !important;
        padding: 1rem !important;
        position: relative !important;
    }
    
    .tutorial-header {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    .tutorial-body {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* 调整字体大小 */
    .sidebar-header h2 {
        font-size: 1rem;
    }
    
    .category-item {
        padding: 0.75rem;
        font-size: 0.95rem;
    }
    
    .category-item.category-level1 {
        font-size: 1rem;
    }
    
    .category-item.category-level2 {
        padding-left: 1.5rem;
        font-size: 0.9rem;
    }
    
    .category-item.category-level3 {
        padding-left: 2rem;
        font-size: 0.85rem;
    }
    
    /* 教程标题 */
    .tutorial-header h2 {
        font-size: 1.5rem;
    }
    
    /* 分享按钮 */
    .share-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .share-btn svg {
        width: 16px;
        height: 16px;
    }
    
    /* 一级目录内容 */
    .level1-content {
        padding: 2rem 1rem;
        font-size: 1rem;
    }
    
    /* 教程内容 */
    .tutorial-body {
        font-size: 0.95rem;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        height: auto !important;
        min-height: 200px !important;
        padding: 1rem 0 !important;
    }
    
    .tutorial-body img {
        margin: 0.75rem 0;
    }
    
    /* 分享弹窗 */
    .share-modal-content {
        width: 95% !important;
        max-width: 95% !important;
        margin: 1rem auto !important;
        box-sizing: border-box !important;
    }
    
    .share-modal-body {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .share-item {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .share-link-container {
        flex-direction: column;
        gap: 0.5rem;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    
    .share-link-container input,
    .share-link-container textarea {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        margin-right: 0 !important;
        padding: 0.75rem !important;
        padding-right: 0.75rem !important;
        box-sizing: border-box !important;
    }
    
    .share-link-container textarea {
        padding-right: 0.75rem !important;
    }
    
    .copy-btn {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    /* 下一篇/第一篇教程链接 */
    .tutorial-next,
    .level1-first-tutorial {
        padding: 1.5rem 1rem;
    }
    
    .next-tutorial-link,
    .first-tutorial-link {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
    
    /* 占位符 */
    .tutorial-placeholder {
        padding: 2rem 1rem;
        font-size: 1rem;
    }
}

/* 小屏幕手机（最大宽度480px） */
@media (max-width: 480px) {
    .sidebar {
        width: 85%;
    }
    
    .main-content {
        padding: 0.75rem;
    }
    
    .tutorial-header h2 {
        font-size: 1.3rem;
    }
    
    .level1-content {
        padding: 1rem 0.75rem !important;
        font-size: 0.95rem;
        min-height: auto !important;
        height: auto !important;
        display: block !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        text-align: left !important;
        position: relative !important;
        top: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    .level1-content-wrapper {
        min-height: auto !important;
        height: auto !important;
        display: block !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        position: relative !important;
        top: 0 !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
    }
    
    .level1-first-tutorial {
        margin-top: 1rem !important;
        padding: 1rem 0.75rem !important;
        position: relative !important;
    }
    
    .tutorial-body {
        font-size: 0.9rem;
    }
    
    .share-modal-content {
        width: 95% !important;
        max-width: 95% !important;
        margin: 1rem auto !important;
        box-sizing: border-box !important;
    }
    
    .share-modal-header,
    .share-modal-body {
        padding: 1rem;
        box-sizing: border-box;
    }
    
    .share-modal-body {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .share-item {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .share-link-container {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    
    .share-link-container input,
    .share-link-container textarea {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        margin-right: 0 !important;
        padding: 0.75rem !important;
        padding-right: 0.75rem !important;
        box-sizing: border-box !important;
    }
    
    .share-link-container textarea {
        padding-right: 0.75rem !important;
    }
}

/* 图片预览弹窗样式 */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10002;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

.image-modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s;
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10003;
    transition: color 0.3s;
    line-height: 1;
    user-select: none;
}

.image-modal-close:hover {
    color: #ccc;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 移动端图片预览优化 */
@media (max-width: 768px) {
    .image-modal-content {
        max-width: 95%;
        max-height: 85%;
    }
    
    .image-modal-close {
        top: 10px;
        right: 20px;
        font-size: 35px;
    }
}

/* PC端底部信息样式 - 已隐藏 */
.site-footer {
    display: none !important;
    visibility: hidden !important;
    width: 100%;
    padding: 2rem 2rem;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 0;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

/* PC端显示footer - 已隐藏 */
@media (min-width: 769px) {
    .site-footer {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        position: relative !important;
        z-index: 10 !important;
        width: 100% !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        height: 0 !important;
        padding: 0 !important;
    }
    
    body {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }
    
    .app-container {
        flex: 1;
    }
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.company-name {
    color: #495057;
}

.footer-separator {
    color: #dee2e6;
}

.icp-link {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.3s;
}

.icp-link:hover {
    color: #3498db;
    text-decoration: underline;
}

/* 确保footer在PC端显示 */
@media (min-width: 769px) {
    .app-container {
        display: flex !important;
        flex-direction: row !important; /* 横向布局：左侧目录，右侧内容 */
        min-height: 100vh !important; /* footer已隐藏，不需要留出空间 */
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        align-items: stretch;
    }
    
    .main-content {
        flex: 1;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        height: calc(100vh - 60px) !important; /* 视口高度减去上下padding */
        min-height: calc(100vh - 60px) !important;
        max-height: calc(100vh - 60px) !important;
        padding-bottom: 2rem !important;
    }
    
    .site-footer {
        display: block !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        position: relative !important; /* 相对定位，不覆盖内容 */
        z-index: 10 !important;
        width: 100% !important;
        margin-top: 3rem !important; /* 增加上方间距，与主内容分离 */
        margin-bottom: 1rem !important; /* 底部留出一些空间 */
        margin-left: 0 !important;
        margin-right: 0 !important;
        background-color: #f8f9fa !important;
        border-top: 1px solid #e9ecef !important;
        padding: 2rem 2rem !important; /* 增加内部padding */
        text-align: center !important;
        visibility: visible !important;
        opacity: 1 !important;
        order: 999 !important; /* 确保在最后 */
        clear: both !important;
        box-sizing: border-box !important;
    }
    
    /* 确保main-content有足够的padding-bottom，避免内容被footer遮挡 */
    .main-content {
        padding-bottom: 1rem !important; /* 减少主内容的padding-bottom，因为footer有自己的margin-top */
    }
}

/* 移动端隐藏footer */
@media (max-width: 768px) {
    .site-footer {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}
