/**
 * Wiki 文档系统样式
 * 
 * @package WordPress
 * @subpackage Wiki_Doc_System
 */

/* ==========================================
   基础样式
   ========================================== */

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

.wiki-article {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   面包屑导航
   ========================================== */

.wiki-breadcrumb {
    margin-bottom: 20px;
    padding: 10px 0;
    font-size: 14px;
    color: #666;
}

.wiki-breadcrumb a {
    color: #0073aa;
    text-decoration: none;
}

.wiki-breadcrumb a:hover {
    color: #00a0d2;
    text-decoration: underline;
}

.wiki-breadcrumb .separator {
    margin: 0 8px;
    color: #999;
}

/* ==========================================
   树形目录
   ========================================== */

.wiki-toc {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
}

.wiki-toc-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.wiki-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wiki-tree-item {
    margin: 5px 0;
    padding: 5px 0;
}

.wiki-tree-item a {
    color: #0073aa;
    text-decoration: none;
    padding: 5px 10px;
    display: block;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.wiki-tree-item a:hover {
    background: #e9ecef;
    color: #005a87;
}

.wiki-tree-item.current-item > a {
    background: #0073aa;
    color: #fff;
    font-weight: bold;
}

.wiki-tree-item.has-children > .wiki-tree {
    margin-left: 20px;
    border-left: 2px solid #e9ecef;
    padding-left: 10px;
}

.wiki-tree-item.expanded > .wiki-tree {
    display: block;
}

.wiki-tree-item.collapsed > .wiki-tree {
    display: none;
}

/* 折叠/展开按钮 */
.wiki-tree-toggle {
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: inline-block;
    text-align: center;
    line-height: 20px;
    margin-right: 5px;
    color: #666;
    transition: transform 0.2s ease;
}

.wiki-tree-toggle:hover {
    color: #333;
}

.wiki-tree-item.expanded > .wiki-tree-toggle {
    transform: rotate(90deg);
}

/* ==========================================
   文章元信息
   ========================================== */

.wiki-meta {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
    font-size: 14px;
    color: #666;
}

.wiki-meta-item {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 10px;
}

.wiki-meta-label {
    font-weight: bold;
    color: #333;
    margin-right: 5px;
}

/* ==========================================
   子文章列表
   ========================================== */

.wiki-children {
    margin: 40px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.wiki-children-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.wiki-children-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wiki-children-item {
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.wiki-children-item:last-child {
    border-bottom: none;
}

.wiki-children-item a {
    color: #0073aa;
    text-decoration: none;
    font-size: 16px;
}

.wiki-children-item a:hover {
    color: #00a0d2;
    text-decoration: underline;
}

/* ==========================================
   上下篇导航
   ========================================== */

.wiki-navigation {
    margin: 40px 0;
    padding: 20px 0;
    border-top: 2px solid #e9ecef;
    border-bottom: 2px solid #e9ecef;
}

.wiki-nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wiki-nav-item {
    flex: 1;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #0073aa;
    transition: all 0.2s ease;
}

.wiki-nav-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.wiki-nav-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.wiki-nav-title {
    font-size: 16px;
    font-weight: bold;
}

.wiki-nav-prev {
    margin-right: 20px;
}

.wiki-nav-next {
    margin-left: 20px;
    text-align: right;
}

.wiki-nav-placeholder {
    visibility: hidden;
}

/* ==========================================
   响应式设计
   ========================================== */

@media (max-width: 768px) {
    .wiki-article {
        padding: 20px;
    }
    
    .wiki-toc {
        padding: 15px;
    }
    
    .wiki-tree-item.has-children > .wiki-tree {
        margin-left: 15px;
    }
    
    .wiki-nav-container {
        flex-direction: column;
    }
    
    .wiki-nav-item {
        margin-bottom: 15px;
    }
    
    .wiki-nav-next {
        text-align: left;
    }
}

/* ==========================================
   暗色模式支持
   ========================================== */

@media (prefers-color-scheme: dark) {
    .wiki-article {
        background: #1e1e1e;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    .wiki-toc {
        background: #2d2d2d;
        border-color: #404040;
    }
    
    .wiki-tree-item a:hover {
        background: #404040;
    }
    
    .wiki-tree-item.current-item > a {
        background: #0073aa;
    }
    
    .wiki-meta {
        background: #2d2d2d;
    }
    
    .wiki-children {
        background: #2d2d2d;
    }
    
    .wiki-nav-item {
        background: #2d2d2d;
    }

    .wiki-nav-item:hover {
        background: #404040;
    }
}

/* ==========================================
   根文章左右分栏布局
   ========================================== */

.wiki-root-layout {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.wiki-root-left {
    flex: 0 0 25%;
    max-width: 25%;
}

.wiki-root-right {
    flex: 0 0 75%;
    max-width: 75%;
    display: flex;
    flex-direction: column;
}

.wiki-featured-image {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wiki-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.wiki-read-button-wrapper {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.wiki-read-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    background: linear-gradient(135deg, #0073aa 0%, #00a0d2 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.wiki-read-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 115, 170, 0.4);
    text-decoration: none;
    color: #fff;
}

.wiki-read-arrow {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.wiki-read-button:hover .wiki-read-arrow {
    transform: translateX(5px);
}

/* 响应式布局 */
@media (max-width: 768px) {
    .wiki-root-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .wiki-root-left {
        flex: 0 0 70%;
        max-width: 70%;
        margin: 0 auto;
    }
    
    .wiki-root-right {
        flex: 1;
        max-width: 100%;
    }
}

/* ==========================================
   子文章列表样式
   ========================================== */

.wiki-child-pages {
    margin-top: 30px;
    padding: 20px;
    background: var(--tb--tint, #f8f9fa);
    border-radius: 8px;
    border-left: 4px solid var(--tb--main, #0073aa);
}

.wiki-child-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--tb--base, #333);
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--tb--line, #e1e1e1);
}

.wiki-child-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wiki-child-list li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--tb--line, #e1e1e1);
}

.wiki-child-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.wiki-child-list li a {
    font-size: 16px;
    font-weight: 500;
    color: var(--tb--base, #333);
    text-decoration: none;
    transition: color 0.2s ease;
}

.wiki-child-list li a:hover {
    color: var(--tb--main, #0073aa);
    text-decoration: underline;
}

.wiki-child-excerpt {
    font-size: 14px;
    color: var(--tb--gray, #666);
    margin: 5px 0 0 0;
    line-height: 1.5;
}
