 /* 发布系统专用样式 */

/* 重置和基础样式 */
* {
    box-sizing: border-box;
}

/* 面包屑导航样式 */
.breadcrumb, .document-breadcrumb {
    background-color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
}

.breadcrumb a, .document-breadcrumb a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb a:hover, .document-breadcrumb a:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* 文件夹导航样式 */
.folder-navigation {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.folder-info h2 {
    color: #2d3748;
    margin: 10px 0;
    font-size: 1.8rem;
}

.folder-stats {
    color: #718096;
    font-size: 0.9rem;
    margin: 8px 0;
}

/* 文件夹树样式 */
.folder-tree {
    margin-top: 10px;
}

/* 新的树状结构样式 */
.tree-structure {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    background-color: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0;
}

.tree-item {
    margin: 2px 0;
    display: flex;
    align-items: center;
}

.tree-line {
    color: #718096;
    white-space: pre;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    user-select: none;
}

.tree-toggle {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 14px;
    text-align: center;
    background-color: #4299e1;
    color: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    margin-right: 6px;
    transition: all 0.2s ease;
    user-select: none;
}

.tree-toggle:hover {
    background-color: #3182ce;
    transform: scale(1.1);
}

.tree-toggle.expanded {
    background-color: #e53e3e;
}

.tree-toggle.expanded:hover {
    background-color: #c53030;
}

.tree-spacer {
    display: inline-block;
    width: 22px;
    margin-right: 0;
}

.folder-link {
    color: #4a5568;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 13px;
}

.folder-link:hover {
    background-color: #edf2f7;
    color: #667eea;
    text-decoration: none;
}

.tree-children {
    margin-left: 0;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}

.tree-children.expanded {
    display: block !important;
}

/* 子文件夹网格 */
.sub-folders {
    margin-bottom: 30px;
}

.sub-folders h3 {
    color: #2d3748;
    margin-bottom: 16px;
    font-size: 1.3rem;
}

.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.folder-card {
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.folder-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.folder-card a {
    text-decoration: none;
    color: #2d3748;
}

.folder-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.folder-name {
    font-weight: 500;
    font-size: 0.95rem;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部导航 */
.publish-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.publish-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.publish-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.publish-header h1 a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.publish-header h1 a:hover {
    text-decoration: underline;
}

/* 搜索栏 */
.search-bar {
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.search-bar form {
    display: flex;
    background: white;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-bar input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    outline: none;
    font-size: 0.9rem;
}

.search-bar button {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.search-bar button:hover {
    background: #5a6fd8;
}

/* 导航菜单 */
.publish-header nav {
    display: flex;
    gap: 1.5rem;
}

.publish-header nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: background-color 0.3s ease;
    font-weight: 500;
}

.publish-header nav a:hover {
    background: rgba(255,255,255,0.2);
}

/* 新的wiki布局 */
.wiki-main {
    display: flex;
    min-height: calc(100vh - 200px);
    margin-top: 0;
    background: #f8f9fa;
}

/* 主要内容区域 */
main.container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* 新的wiki侧边栏 */
.wiki-sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 0;
}

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

.sidebar-header h3 {
    margin: 0 0 0.5rem 0;
    color: #2d3748;
    font-size: 1.1rem;
}

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

.search-mini input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.9rem;
}

.folder-tree-container {
    padding: 1rem;
    flex: 1;
}

.tree-root {
    margin-bottom: 1rem;
}

.root-item {
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.root-item:hover {
    background-color: #edf2f7;
}

.root-item.active {
    background-color: #667eea;
    color: white;
}

.tree-icon {
    margin-right: 0.5rem;
}

.tree-label {
    font-size: 0.9rem;
}

/* 新的树状结构样式 */
.folder-tree .tree-item {
    display: flex;
    align-items: center;
    padding: 0.25rem 0;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
    margin: 1px 0;
}

.folder-tree .tree-item:hover {
    background-color: #edf2f7;
}

.folder-tree .tree-item.active {
    background-color: #e6fffa;
    color: #234e52;
}

.folder-tree .tree-toggle {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #4299e1;
    color: white;
    border-radius: 2px;
    font-size: 10px;
    margin-right: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.folder-tree .tree-toggle:hover {
    background: #3182ce;
}

.folder-tree .tree-children {
    margin-left: 1rem;
    overflow: hidden;
    transition: all 0.2s ease;
}

.document-item .tree-icon {
    color: #4a5568;
}

.folder-item .tree-icon {
    color: #ed8936;
}

/* 侧边栏 */
.sidebar {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar .widget {
    margin-bottom: 2rem;
}

.sidebar .widget:last-child {
    margin-bottom: 0;
}

.sidebar h3 {
    margin: 0 0 1rem 0;
    color: #667eea;
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-cloud .tag {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.tag-cloud .tag:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

/* 新的wiki内容区域 */
.wiki-content {
    flex: 1;
    background: white;
    overflow-y: auto;
    height: 100vh;
}

.wiki-content .content-header {
    padding: 1rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8f9fa;
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #4a5568;
}

.breadcrumb-item {
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
}

.breadcrumb-item.active {
    background: #e2e8f0;
    font-weight: 500;
}

.content-area {
    padding: 2rem;
}

.document-detail {
    padding: 2rem;
}

.detail-header {
    padding: 1rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8f9fa;
}

.back-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.back-btn:hover {
    background: #5a6fd8;
}

.detail-content {
    max-width: none;
}

/* 内容区域 */
.content {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.content-header {
    margin-bottom: 2rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 1rem;
}

.content-header h2 {
    margin: 0 0 0.5rem 0;
    color: #343a40;
    font-size: 1.75rem;
    font-weight: 600;
}

.search-result {
    margin: 0;
    color: #6c757d;
    font-style: italic;
}

/* 文档列表 */
.document-list {
    display: grid;
    gap: 1.5rem;
}

.document-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    background: #fafbfc;
    transition: all 0.3s ease;
    position: relative;
}

.document-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.document-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.document-card h3 a {
    color: #343a40;
    text-decoration: none;
    transition: color 0.3s ease;
}

.document-card h3 a:hover {
    color: #667eea;
}

.document-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.document-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.document-tags {
    margin-bottom: 1rem;
}

.document-tags .tag {
    background: #667eea;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    display: inline-block;
    text-decoration: none;
    transition: all 0.3s ease;
}

.document-tags .tag:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.document-excerpt {
    color: #495057;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* 无文档状态 */
.no-documents {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.no-documents p {
    font-size: 1.1rem;
    margin: 0;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    text-decoration: none;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #495057;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination .current {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 文档详情页 */
.document-content {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.document-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e9ecef;
}

.document-header h1 {
    margin: 0 0 1rem 0;
    color: #343a40;
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.3;
}

.document-body {
    font-size: 1rem;
    line-height: 1.7;
    color: #495057;
}

.document-body h1,
.document-body h2,
.document-body h3,
.document-body h4,
.document-body h5,
.document-body h6 {
    color: #343a40;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.document-body h1 {
    font-size: 1.75rem;
}

.document-body h2 {
    font-size: 1.5rem;
}

.document-body h3 {
    font-size: 1.25rem;
}

.document-body p {
    margin-bottom: 1rem;
}

.document-body pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 1rem;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 代码块内的code元素 */
.document-body pre code {
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    color: inherit !important;
    font-size: inherit !important;
    font-family: inherit !important;
    display: block;
    white-space: pre;
}

/* 行内代码 */
.document-body code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    color: #e83e8c;
}

.document-body blockquote {
    border-left: 4px solid #667eea;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #6c757d;
    font-style: italic;
}

.document-body ul,
.document-body ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

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

/* 文档侧边栏 */
.document-sidebar {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.related-docs {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-docs li {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.related-docs li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.related-docs a {
    color: #495057;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.related-docs a:hover {
    color: #667eea;
}

/* 底部 */
.publish-footer {
    background: #343a40;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

.publish-footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .publish-header .container {
        flex-direction: column;
        text-align: center;
    }
    
    .search-bar {
        margin: 1rem 0;
        max-width: 100%;
    }
    
    .publish-header nav {
        justify-content: center;
    }
    
    /* 新的wiki布局响应式 */
    .wiki-main {
        flex-direction: column;
        height: auto;
    }
    
    .wiki-sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        max-height: 300px;
        overflow-y: auto;
    }
    
    .wiki-content {
        height: auto;
    }
    
    main.container {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 1rem;
    }
    
    .sidebar {
        order: 2;
        position: static;
    }
    
    .content {
        order: 1;
        padding: 1.5rem;
    }
    
    .document-content {
        padding: 1.5rem;
    }
    
    .document-header h1 {
        font-size: 1.5rem;
    }
    
    .content-header h2 {
        font-size: 1.5rem;
    }
    
    .document-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .pagination a,
    .pagination span {
        padding: 0.25rem 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .content,
    .document-content {
        padding: 1rem;
    }
    
    .search-bar form {
        border-radius: 20px;
    }
    
    .search-bar input,
    .search-bar button {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}