/* 文档页面专用样式 */

* {
    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;
    background-color: #f5f5f5;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

/* 顶部导航栏 */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #fff;
    box-shadow: 0 1px 0 0 rgba(0, 0, 0, .06);
    display: flex;
    align-items: center;
    padding: 0;
    z-index: 100;
}

.logo {
    font-size: 18px;
    font-weight: 600;
    color: #1f2329;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 0 24px;
    margin-left: 60px; /* 距离屏幕左侧60px */
}

.logo img {
    height: 24px;
    margin-right: 8px;
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: #e5e5e5;
    margin: 0 16px;
}

.page-title {
    font-size: 16px;
    font-weight: 500;
    color: #1f2329;
    flex: 1;
    margin-left: 300px; /* 距离屏幕左侧300px */
}

/* 面包屑导航样式 */
.breadcrumb-link {
    color: #007cba;
    text-decoration: none;
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

.breadcrumb-current {
    color: #1f2329;
    font-weight: 500;
}

.breadcrumb-separator {
    color: #999;
    margin: 0 8px;
}

.user-info {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #646a73;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #007cba;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;
    font-weight: 500;
}

/* 主内容区域 */
.main-container {
    display: flex;
    height: calc(100vh - 56px);
    margin-top: 56px;
}

/* 左侧边栏 */
.sidebar {
    width: 280px;
    background: #fff;
    border-right: 1px solid #e5e5e5;
    overflow-y: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px 24px 10px;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2329;
    margin-bottom: 0;
    display: flex;
    align-items: center;
}

.sidebar-title img {
    height: 24px;
    margin-right: 8px;
}

.sidebar-search {
    position: relative;
    padding: 0 24px 16px;
}

.sidebar-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
}

.sidebar-search input:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* 垂直树形结构样式 - 参照旧版本做法 */
.projects-tree {
    padding: 0;
    flex: 1;
    overflow-y: auto;
}

.projects-tree > ul {
    list-style-type: none;
    margin: 0;
    display: block;
    padding: 0;
}

.projects-tree ul ul {
    list-style-type: none;
    margin: 0;
    display: none;
    padding: 0;
}

.projects-tree li {
    margin: 0;
    cursor: pointer;
    position: relative;
    padding-left: 0;
}

.projects-tree li.active > ul {
    display: block;
}

/* 一级项目样式 */
.projects-tree .level-1 {
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}

.projects-tree .level-1 > a {
    font-weight: 600;
    font-size: 15px;
    padding: 8px 16px;
    display: block;
    color: #1f2329;
    text-decoration: none;
}

.projects-tree .level-1 > a:hover {
    background-color: #f5f5f5;
}

.projects-tree .level-1 > a.active,
.projects-tree .level-1 > a.active:hover {
    background-color: #e6f7ff;
    color: #007cba;
}

/* 二级项目样式 */
.projects-tree .level-2-children {
    list-style: none;
    padding: 0 0 8px 0 !important;
    margin: 0 !important;
    display: none;
}

.projects-tree .level-1.active > .level-2-children {
    display: block;
}

.projects-tree .level-2 {
    padding: 0;
}

.projects-tree .level-2 > a {
    font-weight: 400;
    font-size: 14px;
    padding: 6px 16px 6px 36px;
    display: block;
    color: #444;
    text-decoration: none;
}

.projects-tree .level-2 > a:hover {
    background-color: #f5f5f5;
}

.projects-tree .level-2 > a.active,
.projects-tree .level-2 > a.active:hover {
    background-color: #e6f7ff;
    color: #007cba;
}

/* 图标容器 */
.icon-container {
    position: absolute;
    left: 16px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* 一级项目图标容器 */
.level-1 > .icon-container {
    left: 16px;
}

/* 二级项目图标容器 */
.level-2 > .icon-container {
    left: 36px;
}

/* 三角形图标（用于有子项目的节点） */
.icon-container.triangle::before {
    content: "";
    display: block;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 8px solid #000;
    transition: transform 0.2s;
}

/* 打开状态的三角形图标 */
.icon-container.triangle.open::before {
    transform: rotate(90deg);
    transform-origin: 50% 50%;
}

/* 圆圈图标（用于没有子项目的节点） */
.icon-container.circle::before {
    content: "";
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #000;
}

/* 项目链接样式 */
.projects-tree a {
    font-weight: 400;
    color: #1f2329;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-block;
    max-width: calc(100% - 20px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.projects-tree a:hover {
    background-color: #f0f0f0;
}

.projects-tree a.active {
    background-color: #e6f7ff;
    color: #007cba;
}

/* 一级项目链接样式 */
.projects-tree .level-1 > a {
    font-weight: 600;
    font-size: 15px;
    padding: 8px 16px 8px 36px;
    display: block;
}

/* 二级项目链接样式 */
.projects-tree .level-2 > a {
    font-weight: 400;
    font-size: 14px;
    padding: 6px 16px 6px 56px;
    display: block;
}

/* 中间列标题 */
.middle-column-header {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.middle-column-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1f2329;
    margin: 0;
}

/* 中间列标题区域拖动条 */
.column-header-resizer {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: transparent;
    cursor: col-resize;
    z-index: 100;
    transition: background 0.2s ease;
}

.column-header-resizer:hover {
    background: #e5e5e5;
}

.column-header-resizer.dragging {
    background: #007cba;
}

/* 中间列垂直树形结构样式 */
.sub-projects-container {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.sub-projects-list {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: none;
}

.sub-projects-list.active {
    display: block;
}

/* 默认显示三级项目列表 */
.sub-projects-list.level-3-list {
    display: block;
}

.sub-projects-list li {
    margin: 0;
    cursor: pointer;
    position: relative;
    padding-left: 0;
}

.sub-projects-list li.active > ul {
    display: block;
}

/* 项目链接样式 */
.sub-projects-list .level-3 > a,
.sub-projects-list .level-4 > a,
.sub-projects-list .level-5 > a {
    font-weight: 400;
    font-size: 13px;
    display: block;
    color: #444;
    text-decoration: none;
    padding: 6px 16px 6px 32px;
}

/* 三级项目链接样式 */
.sub-projects-list .level-3 > a {
    padding: 6px 16px 6px 48px;
}

/* 四级项目链接样式 */
.sub-projects-list .level-4 > a {
    padding: 6px 16px 6px 64px;
}

/* 五级项目链接样式 */
.sub-projects-list .level-5 > a {
    padding: 6px 16px 6px 80px;
}

.sub-projects-list .level-3 > a:hover,
.sub-projects-list .level-4 > a:hover,
.sub-projects-list .level-5 > a:hover {
    background-color: #f5f5f5;
}

.sub-projects-list .level-3 > a.active,
.sub-projects-list .level-4 > a.active,
.sub-projects-list .level-5 > a.active {
    background-color: #e6f7ff;
    color: #007cba;
}

.sub-projects-list .icon-container {
    position: absolute;
    left: 32px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* 三级项目图标容器 */
.sub-projects-list .level-3 > .icon-container {
    left: 32px;
}

/* 四级项目图标容器 */
.sub-projects-list .level-4 > .icon-container {
    left: 48px;
}

/* 五级项目图标容器 */
.sub-projects-list .level-5 > .icon-container {
    left: 64px;
}

.middle-column .icon-container.triangle::before {
    content: "";
    display: block;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 8px solid #000;
    transition: transform 0.2s;
}

.middle-column .icon-container.triangle.open::before {
    transform: rotate(90deg);
    transform-origin: 50% 50%;
}

.middle-column .icon-container.circle::before {
    content: "";
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #000;
}

.middle-column a {
    color: #444;
    text-decoration: none;
    font-size: 13px;
    padding: 4px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
    display: inline-block;
    max-width: calc(100% - 16px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.middle-column a:hover {
    background-color: #f5f5f5;
}

.middle-column a.active {
    background-color: #e6f7ff;
    color: #007cba;
}

/* 右侧内容区域 */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 0 30px 0 20px; /* 右侧padding改为30px，距离屏幕边缘30像素 */
}

.content-wrapper {
    max-width: none; /* 移除最大宽度限制，让内容区域100%填充 */
    margin: 0;
    background: #fff;
    padding: 40px;
    min-height: 100%;
}

.content-header {
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.content-title {
    font-size: 32px;
    font-weight: 600;
    color: #1f2329;
    line-height: 1.3;
}

.content-body {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
}

.content-body h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 32px 0 16px;
    color: #1f2329;
}

.content-body h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 24px 0 12px;
    color: #1f2329;
}

.content-body p {
    margin: 16px 0;
}

.content-body ul,
.content-body ol {
    margin: 16px 0;
    padding-left: 32px;
}

.content-body li {
    margin: 8px 0;
}

.content-body a {
    color: #007cba;
    text-decoration: none;
}

.content-body a:hover {
    text-decoration: underline;
}

.content-body code {
    background: #f5f5f5;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 14px;
}

.content-body pre {
    background: #f5f5f5;
    padding: 16px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 16px 0;
}

.content-body pre code {
    background: none;
    padding: 0;
}

.content-body blockquote {
    border-left: 4px solid #007cba;
    padding: 4px 0 4px 16px;
    margin: 16px 0;
    color: #666;
}

.content-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 16px 0;
}

.content-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.content-body table th,
.content-body table td {
    border: 1px solid #e5e5e5;
    padding: 12px;
    text-align: left;
}

.content-body table th {
    background: #f5f5f5;
    font-weight: 600;
}

/* 按钮样式 */
.sidebar-controls {
    padding: 12px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 30px; /* 间距放大到30px */
    justify-content: center; /* 居中对齐 */
    align-items: center; /* 垂直居中 */
}

.sidebar-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px; /* 字体放大一级 */
    color: #666;
}

.sidebar-btn:hover {
    background: #e5e5e5;
}

/* 外部链接图标 */
.external-link-icon {
    margin-left: 4px;
    font-size: 12px;
}

/* 空状态 */
.empty-state {
    padding: 16px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.empty-content,
.welcome-content {
    text-align: center;
    padding: 40px 0;
    color: #999;
}

/* 列调整器 */
.column-resizer, .column-header-resizer {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: transparent;
    cursor: col-resize;
    z-index: 100;
    transition: background 0.2s ease; /* 添加过渡效果 */
}

.column-resizer:hover, .column-header-resizer:hover {
    background: #e5e5e5;
}

/* 拖动时的样式 */
.column-resizer.dragging, .column-header-resizer.dragging {
    background: #007cba;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .content-wrapper {
        max-width: none; /* 移除最大宽度限制，保持一致的布局 */
        padding: 32px;
    }
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
        max-height: 200px;
    }
    
    .content-area {
        height: auto;
    }
}