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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: #fff;
    min-height: 100vh;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 24px;
    font-weight: 600;
}

.search-box {
    display: flex;
    gap: 10px;
}

.search-box input {
    padding: 8px 15px;
    border: none;
    border-radius: 20px;
    width: 250px;
    font-size: 14px;
    outline: none;
}

.search-box button {
    padding: 8px 18px;
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.search-box button:hover {
    background-color: white;
    color: #667eea;
}

.main-content {
    display: flex;
    min-height: calc(100vh - 72px);
}

.sidebar {
    width: 220px;
    background-color: #f5f5f5;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.sidebar.collapsed {
    transform: translateX(-220px);
}

.sidebar-header {
    padding: 12px 15px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.toggle-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #666;
    padding: 5px;
}

.menu {
    list-style: none;
    padding: 0;
}

.menu-item {
    padding: 0;
}

.module-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    font-size: 14px;
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    border-left: 3px solid transparent;
}

.module-title .module-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.module-title:hover {
    background-color: #e8f4ff;
    color: #1890ff;
}

.module-title.active {
    background-color: #e8f4ff;
    color: #1890ff;
    border-left-color: #1890ff;
}


.content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background-color: #fff;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
    color: #6c757d;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.breadcrumb-item a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    color: #dee2e6;
}

.breadcrumb-current {
    color: #495057;
    font-weight: 500;
}

.welcome-view {
    padding: 20px 0;
}

.section-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.module-section {
    border-bottom: none;
    padding-bottom: 0;
}

.module-section:last-child {
    border-bottom: none;
}

.module-section-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.module-section-title:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.module-section-title::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 24px;
    background-color: #667eea;
    border-radius: 3px;
    flex-shrink: 0;
}

.module-section-title:hover::before {
    background-color: white;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px 30px;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.link-item a {
    color: #409eff;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.link-item a:hover {
    color: #66b1ff;
    text-decoration: underline;
}

.link-arrow {
    color: #409eff;
    font-size: 12px;
}

/* NEW标签样式 */
.new-badge {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.module-view {
    display: flex;
    flex-direction: column;
}

.file-view {
    display: flex;
    flex-direction: column;
}

.detail-view {
    display: flex;
    flex-direction: column;
}

.common-section {
    background: #f5f5f5;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.common-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 16px 0;
    padding-left: 8px;
    border-left: 4px solid #667eea;
}

.file-section-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.links-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 20px;
}

.links-grid-3 .link-item {
    margin-bottom: 0;
}

.common-section .link-arrow {
    display: none;
}

.common-section .link-item a {
    color: #333;
}

.common-section .link-item a:hover {
    color: #409eff;
}

.markdown-body {
    line-height: 1.8;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

.error {
    background: #fef0f0;
    border: 1px solid #fde2e2;
    border-radius: 8px;
    padding: 20px;
    color: #f56c6c;
}

.error h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.error p {
    margin: 5px 0;
}

.markdown-body h1 {
    font-size: 24px;
    color: #667eea;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
    text-align: center;
}

.markdown-body h2 {
    font-size: 20px;
    color: #495057;
    margin: 25px 0 15px;
}

.markdown-body h3 {
    font-size: 18px;
    color: #6c757d;
    margin: 20px 0 12px;
}

.markdown-body h4 {
    font-size: 16px;
    color: #495057;
    margin: 18px 0 10px;
}

.markdown-body p {
    margin: 12px 0;
    color: #495057;
    font-size: 14px;
}

.markdown-body ol, .markdown-body ul {
    margin: 12px 0;
    padding-left: 25px;
}

.markdown-body ul li {
    margin: 6px 0;
    color: #495057;
    font-size: 14px;
}

/* 有序列表样式 - 淡蓝色圆形数字 */
.markdown-body ol {
    list-style: none;
    padding-left: 0;
    counter-reset: step-counter;
}

.markdown-body ol li {
    margin: 20px 0;
    color: #495057;
    font-size: 14px;
    counter-increment: step-counter;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.markdown-body ol li::before {
    content: counter(step-counter);
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background-color: #74c0fc;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
}

/* H3步骤标题样式 - 淡蓝色圆形数字（格式：### 1.标题） */
.markdown-body h3 {
    font-size: 16px;
    color: #495057;
    margin: 18px 0 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 0;
}

.markdown-body h3::before {
    content: '';
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background-color: #74c0fc;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
}

/* 提取h3标题中的数字并显示在圆形中 */
.markdown-body h3[data-step-number]::before {
    content: attr(data-step-number);
}

.markdown-body img {
    max-width: 100%;
    height: auto;
    margin: 15px 0;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.markdown-body hr {
    border: none;
    border-top: 1px solid #e9ecef;
    margin: 30px 0;
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.6);
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 80px 20px;
    color: #6c757d;
    font-size: 16px;
}

.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 20px;
    border-radius: 6px;
    margin: 20px 0;
    font-size: 14px;
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 72px;
        height: calc(100vh - 72px);
        z-index: 999;
    }
    
    .search-box input {
        width: 180px;
    }
    
    .content {
        padding: 20px;
        max-width: 100%;
    }
    
    .links-grid {
        grid-template-columns: 1fr;
    }
    
    .links-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 响应式有序列表 - 手机上稍小一点 */
    .markdown-body ol li::before {
        width: 32px;
        height: 32px;
        font-size: 16px;
        background-color: #74c0fc;
        color: #ffffff;
    }
    
    /* 响应式h3步骤标题 - 平板 */
    .markdown-body h3::before {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    /* 响应式首页模块标题 - 平板 */
    .module-section-title {
        font-size: 18px;
        padding: 16px;
    }
    
    .module-section-title::before {
        height: 20px;
    }
}

@media (max-width: 576px) {
    header {
        flex-direction: column;
        gap: 12px;
        padding: 15px 20px;
    }
    
    header h1 {
        font-size: 18px;
    }
    
    .search-box {
        width: 100%;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .content {
        padding: 15px;
    }
    
    .markdown-body h1 {
        font-size: 20px;
    }
    
    .markdown-body h2 {
        font-size: 18px;
    }
    
    .links-grid-3 {
        grid-template-columns: 1fr;
    }
    
    /* 手机上有序列表再小一点 */
    .markdown-body ol li::before {
        width: 28px;
        height: 28px;
        font-size: 14px;
        background-color: #74c0fc;
        color: #ffffff;
    }
    
    .markdown-body ol li {
        gap: 10px;
    }
    
    /* 响应式h3步骤标题 - 手机 */
    .markdown-body h3::before {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    /* 响应式首页模块标题 - 手机 */
    .module-section-title {
        font-size: 16px;
        padding: 14px 16px;
    }
    
    .module-section-title::before {
        height: 18px;
        width: 5px;
    }
    
    .section-container {
        gap: 20px;
    }
}

.highlight {
    background-color: #fff3cd;
    padding: 2px 4px;
    border-radius: 3px;
}
