nex_docus/frontend/src/pages/Document/DocumentPage.css

522 lines
8.9 KiB
CSS

.project-docs-page {
height: calc(100vh - 64px);
margin: -16px;
padding: 8px;
box-sizing: border-box;
overflow: hidden;
background: var(--bg-color);
}
.docs-layout {
height: 100%;
background: var(--bg-color);
}
.docs-sider {
border-right: 1px solid var(--border-color);
height: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
background: var(--sider-bg);
}
/* 修复 Sider 内部 flex 布局 */
.docs-sider .ant-layout-sider-children {
display: flex;
flex-direction: column;
height: 100%;
}
.docs-sider-header {
padding: 12px 10px 12px;
border-bottom: 1px solid var(--border-color);
display: flex;
flex-direction: column;
gap: 10px;
background: var(--header-bg);
}
.docs-sider-header h2 {
margin: 0;
font-size: 20px;
font-weight: 700;
letter-spacing: 0;
color: var(--text-color);
line-height: 1.1;
text-transform: none;
}
.docs-sider-title-row {
display: flex;
align-items: center;
gap: 14px;
min-width: 0;
}
.docs-sider-title-row h2 {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.project-back-button {
width: 28px;
height: 28px;
border: none;
border-radius: 999px;
display: inline-flex;
align-items: center;
justify-content: center;
background: transparent;
color: var(--text-color-secondary);
font-size: 16px;
cursor: pointer;
flex-shrink: 0;
transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.project-back-button:hover {
background: var(--item-hover-bg);
color: var(--text-color);
transform: translateX(-1px);
}
.project-back-button:focus-visible {
outline: 2px solid rgba(22, 119, 255, 0.35);
outline-offset: 2px;
}
.docs-sider-actions {
display: flex;
align-items: center;
}
.mode-actions-row {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
.mode-actions-group {
display: inline-flex;
align-items: center;
}
.docs-sider-actions .mode-actions-group .ant-btn {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
color: var(--text-color-secondary);
}
.docs-sider-actions .mode-actions-group .ant-btn:hover {
background: var(--item-hover-bg);
border-color: var(--border-color);
color: var(--link-color);
}
.docs-menu {
flex: 1;
overflow-y: auto;
overflow-x: hidden;
border-right: none;
background: var(--sider-bg);
color: var(--text-color);
}
.docs-menu .ant-menu-item,
.docs-menu .ant-menu-submenu-title {
overflow: hidden;
}
.docs-menu .ant-menu-title-content {
display: flex;
align-items: center;
min-width: 0;
overflow: hidden;
}
.docs-menu-label {
display: flex;
align-items: center;
gap: 6px;
width: 100%;
min-width: 0;
}
.docs-menu-label-text {
flex: 1;
min-width: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.docs-menu-share-icon {
color: var(--link-color);
font-size: 12px;
flex: none;
opacity: 0.9;
}
.docs-content-layout {
position: relative;
height: 100%;
background: var(--bg-color);
}
.docs-content {
height: 100%;
overflow-y: auto;
background: var(--bg-color);
}
.docs-content-header {
position: sticky;
top: 0;
z-index: 5;
min-height: 57px;
padding: 16px 24px;
border-bottom: 1px solid var(--border-color);
background: var(--header-bg);
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
}
.docs-header-title {
display: flex;
align-items: center;
min-width: 0;
flex: 1;
overflow: hidden;
white-space: nowrap;
gap: 0;
font-size: 16px;
font-weight: 600;
color: var(--text-color);
}
.docs-header-item {
display: inline-flex;
align-items: center;
min-width: 0;
flex: 0 1 auto;
gap: 6px;
}
.docs-header-icon {
font-size: 15px;
color: var(--text-color-secondary);
flex: none;
}
.docs-header-text {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.docs-header-actions {
flex: none;
}
.pdf-header-toolbar {
min-width: 0;
overflow-x: auto;
overflow-y: hidden;
}
.pdf-header-toolbar .pdf-toolbar {
white-space: nowrap;
}
.docs-content-wrapper {
max-width: 900px;
margin: 0 auto;
padding: 24px;
min-height: 100%;
}
.docs-content-wrapper.large-markdown-mode {
max-width: 100%;
height: calc(100% - 57px);
min-height: 0;
padding: 0 0 24px;
}
/* PDF模式下使用全宽 */
.docs-content-wrapper.pdf-mode {
max-width: 100%;
padding: 0;
height: 100%;
display: flex;
flex-direction: column;
}
.docs-loading {
display: flex;
justify-content: center;
align-items: center;
min-height: 400px;
}
.docs-folder-placeholder {
min-height: 360px;
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
color: var(--text-color-secondary);
font-size: 14px;
}
/* ===== 文件夹内容视图 ===== */
.docs-folder-view {
padding: 4px 0 24px;
}
.docs-folder-toolbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 10px 14px;
margin-bottom: 16px;
background: var(--bg-color-secondary);
border: 1px solid var(--border-color);
border-radius: 10px;
color: var(--text-color-secondary);
font-size: 13px;
min-width: 0;
}
.docs-folder-path {
display: inline-flex;
align-items: center;
gap: 8px;
min-width: 0;
}
.docs-folder-path-icon {
flex: none;
color: #faad14;
font-size: 15px;
}
.docs-folder-path-text {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-weight: 500;
color: var(--text-color);
}
.docs-folder-counts {
flex: none;
white-space: nowrap;
}
.docs-folder-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
gap: 14px;
}
.docs-folder-item {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 8px;
padding: 16px 18px;
border: 1px solid var(--border-color);
border-radius: 12px;
background: var(--card-bg);
cursor: pointer;
transition: all 0.2s ease;
min-width: 0;
}
.docs-folder-item:hover {
border-color: var(--link-color);
box-shadow: var(--panel-shadow);
transform: translateY(-2px);
}
.docs-folder-item:active {
transform: translateY(0);
}
.docs-folder-item-icon {
font-size: 28px;
line-height: 1;
color: #faad14;
}
.docs-folder-item-icon.md {
color: var(--link-color);
}
.docs-folder-item-icon.pdf {
color: #f5222d;
}
.docs-folder-item-name {
width: 100%;
display: inline-flex;
align-items: center;
gap: 6px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 14px;
font-weight: 500;
color: var(--text-color);
min-width: 0;
}
.docs-folder-item-share {
flex: none;
color: var(--link-color);
font-size: 12px;
}
.docs-folder-item-count {
font-size: 12px;
color: var(--text-color-secondary);
}
.markdown-body {
font-size: 16px;
line-height: 1.6;
color: var(--text-color);
background-color: var(--bg-color);
}
.markdown-body h1 {
font-size: 32px;
font-weight: 600;
margin-top: 24px;
margin-bottom: 16px;
padding-bottom: 8px;
border-bottom: 1px solid var(--border-color);
color: var(--text-color);
}
.markdown-body h2 {
font-size: 24px;
font-weight: 600;
margin-top: 24px;
margin-bottom: 16px;
padding-bottom: 8px;
border-bottom: 1px solid var(--border-color);
color: var(--text-color);
}
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
font-weight: 600;
margin-top: 20px;
margin-bottom: 12px;
color: var(--text-color);
}
.markdown-body h3 { font-size: 20px; }
.markdown-body p {
margin-bottom: 16px;
color: var(--text-color);
}
.markdown-body code {
background-color: var(--code-bg);
padding: 2px 6px;
border-radius: 3px;
font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
font-size: 14px;
color: var(--text-color);
}
.markdown-body pre {
background-color: var(--code-bg);
padding: 16px;
border-radius: 6px;
overflow-x: auto;
margin-bottom: 16px;
}
.markdown-body pre code {
background-color: transparent;
padding: 0;
color: inherit;
}
.markdown-body blockquote {
padding: 0 16px;
border-left: 4px solid var(--blockquote-border-color);
color: var(--blockquote-text-color);
margin-bottom: 16px;
}
.markdown-body table {
border-collapse: collapse;
width: 100%;
margin-bottom: 16px;
display: block;
overflow-x: auto;
}
.markdown-body th,
.markdown-body td {
border: 1px solid var(--table-border-color);
padding: 8px 13px;
color: var(--text-color);
}
.markdown-body th {
background-color: var(--table-header-bg);
font-weight: 600;
}
.markdown-body img {
max-width: 100%;
height: auto;
}
.markdown-body a {
color: var(--link-color);
text-decoration: none;
}
.markdown-body a:hover {
text-decoration: underline;
}
.markdown-body ul,
.markdown-body ol {
margin-bottom: 16px;
padding-left: 2em;
color: var(--text-color);
}
.markdown-body li {
margin-bottom: 4px;
}
@media (max-width: 768px) {
.project-docs-page {
padding: 8px;
}
}