* {
    
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


html,
body {
    height: 100%;
    -webkit-overflow-scrolling: touch;

}
body {
    overflow-x: hidden; /* 确保body不产生横向溢出 */
}
.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: visible; /* 新增 */
}

a {
    text-decoration: none !important;
}

#category-container-placeholder {
    background-color: #004295;
    display: block;
}

.top-panel {
    width: 100%;
    max-height: 200px;
    /* 可根据需要调整高度 */
    resize: vertical;
    /* 允许垂直调整大小 */
    min-height: 100px;
    /* 最小高度 */
    display: flex;
    /* 新增：启用flex布局 */
    align-items: center;
    /* 新增：垂直居中 */
}

.main-panel {
    flex: 1;
    width: 100%;
    background-color: rgb(235, 235, 235);
    position: relative;
    overflow: auto;
    z-index: 10; /* 确保不超过下拉菜单的层级 */
}

.title-bar h1 {
    color: rgb(0, 0, 0);
    margin-left: 10px;
}

.left-panel .toggle-btn {
    position: absolute;
    top: 0;
    right: 0;
    padding: 5px;
    background-color: #00afffa8;
    color: #edff00;
    border: none;
    cursor: pointer;
    z-index: 2;
}

/* 顶部栏样式 */
.top-bar {
    height: 130px;
    /* background-color: #007bff; */
    display: flex;
    align-items: center;
    padding: 15px 0;
    color: #ffffff;
    margin: 0 auto;
    max-width: 1350px;
    width: 100%;
    position: relative;
}

.top-bar-title {
    margin: 0 20px;
    color: #000000;
    font-weight: 600;
    white-space: nowrap;
}

.site-url {
    font-size: 14px;
    color: #000000;
    white-space: nowrap;
}

#title-editor {
    margin-bottom: 10px;
}

#edit-title {
    width: 100%;
    padding: 5px;
    margin-top: 5px;
}

.folder-icon {
    margin-left: 10px;
    margin-right: 5px;
}

.title {
    margin-right: 5px;
    font-size: 13px;
}

.buttons-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}



.login-btn {
    margin-left: 5px;
    padding: 5px 10px;
    background-color: rgb(88, 86, 213);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.login-btn a {
    color: white;
    text-decoration: none;
    display: block;
    height: 100%;
    width: 100%;
    cursor: pointer;
}

.markdown-editor {
    width: 100%;
    height: calc(100% - 45px);
    max-height: 500px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: rgb(33, 35, 39);
    color: white;
    resize: none;
    font-family: monospace;
    margin-top: 10px;
}
        .countdown {
            display: inline-block;
            font-size: 2rem;
            font-weight: bold;
            color: #e74c3c;
            background-color: #f9f9f9;
            padding: 10px 20px;
            border-radius: 10px;
            margin: 15px 0;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }
.search-container {
    display: flex;
    align-items: center;
    margin-left: 20px;
    /* 新增：与top-bar保持间距 */
    position: relative;
    width: 300px;
}

#search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    z-index: 9999;
}

.search-box {
    flex: 1;
    height: 33px;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 14px;
    background-color: rgb(241, 241, 241);
    width: 100%;
    /* 新增：填满容器 */
}

    /* 添加悬停效果 */
.category-item:hover .subcategory-dropdown {
    display: block !important;
}

.subcategory-dropdown {
    /* 保持原有样式 */
    transition: all 0.3s ease;
}
    
    /* 二级分类悬停效果 */
    .subcategory-dropdown a:hover {
        background-color: rgba(35, 85, 222);
        color: white !important;
    }

/* 隐藏滚动条 */
.subcategory-dropdown::-webkit-scrollbar {
    display: none;
}
    /* 添加悬停触发规则 */
.category-item.nav-item:hover > .subcategory-dropdown {
    display: block !important;
}
    
    /* 保持下拉菜单在悬停时保持显示 */
    .subcategory-dropdown:hover {
        display: block !important;
    }
/* 缩略图样式 */
.article-thumbnail {
    flex: 0 0 200px;
    margin-right: 20px;
}

.article-thumbnail img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.article-thumbnail:hover img {
    transform: scale(1.03);
}

.article-item {
    display: flex;
    margin-bottom: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 新增卡片布局样式 */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px;
}

.article-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.card-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9纵横比 */
    overflow: hidden;
}

.thumbnail-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.card-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card-thumbnail:hover img {
    transform: scale(1.05);
}

.card-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 5px;
    text-align: center;
}

.card-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.card-title a:hover {
    color: #007bff;
}

.card-meta {
    font-size: 0.9em;
    color: #666;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.author {
    color: #007bff;
    font-weight: 500;
}

.divider {
    margin: 0 8px;
    color: #ccc;
}

.date {
    white-space: nowrap;
}

#article-content {
    height: auto; /* 修改原有固定高度 */
    min-height: 100%; /* 确保内容撑满容器 */
    overflow-x: hidden; 
    padding: 20px;
    box-sizing: border-box;
}

#article-content h2 {
    margin-bottom: 15px;
    color: #333;
}

#article-content h3 {
    margin: 15px 0;
    color: #666;
}

#article-content ul {
    padding-left: 20px;
    margin: 10px 0;
}

#article-content li {
    margin: 5px 0;
    padding: 5px;
    border-bottom: 1px solid #eee;
}


/* 二级分类选中样式 */
    .subcategory-item.active {
        background-color: #003366 !important;
        color: white !important;
    }
    .subcategory-item.active a {
        color: white !important;
    }

    .category-container {
        background-color: #000;
        color: #fff;
        padding: 10px;
        white-space: nowrap;
        overflow-x: auto;
        -ms-overflow-style: none;  /* IE和Edge */
        scrollbar-width: none;  /* Firefox */
    }

.slider-container {
    position: relative;
    z-index: 0;
    margin-top: 0;
}

.slider-item img {
    vertical-align: bottom; /* 消除图片底部间隙 */
}

    .category-item {
        padding: 5px 10px;
        position: relative;
    }

.category-item a {
    color: white;
    text-decoration: none;
}

.category-item a:hover {
    text-decoration: underline;
    color: #ddd;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: rgb(0, 0, 0);

    cursor: pointer;
}

    .category-list {
        display: flex;
        gap: 15px;
        list-style: none;
        padding: 0;
        margin: 0;
        -ms-overflow-style: none;  /* IE和Edge */
        scrollbar-width: none;  /* Firefox */
    }

/* 滚动条轨道 */
.category-list::-webkit-scrollbar-track,
.category-list::-webkit-scrollbar-thumb,
.category-list::-webkit-scrollbar {
    display: none;
}

.category-list,
.sub-category-list {
    list-style: none;
    padding-left: 20px;
    /* 滚动条轨道 */
    &::-webkit-scrollbar-track,
    &::-webkit-scrollbar-thumb,
    &::-webkit-scrollbar {
        display: none;
    }
}

.toggle-icon {
    cursor: pointer;
    margin-right: 5px;
    user-select: none;
}

.cate-title {
    padding-left: 0;
    text-align: left;
    display: block;
    text-decoration: none;
    color: rgb(0, 0, 0);
    font-weight: bold;
}



.category-header,
.sub-category-header {

    cursor: pointer;
    display: flex;
    align-items: center;
}

.category-header:hover,
.sub-category-header:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.category-list li {
    color: rgb(0, 0, 0);
    padding: 5px 0;
    cursor: pointer;
    font-size: 14px;
    padding-left: 20px;
}


.new-doc-btn {
    margin-left: 10px;
    padding: 5px;
    background-color: rgb(88, 86, 213);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.right-panel {
    flex: 1;
    height: auto;
    min-height: 600px; /* 保证最小高度 */
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 60px 60px;
    margin-top: 140px;
    position: relative;
}
/* 添加强制滚动条策略 */
@supports (scrollbar-gutter: stable) {
  .right-panel {
    scrollbar-gutter: stable;
  }
}
/* 添加强制滚动条策略 */
@supports (scrollbar-gutter: stable) {
  .right-panel {
    scrollbar-gutter: stable;
  }
}
/* 重要：覆盖可能存在的隐藏设置 */
body, html, .main-panel {
    overflow: visible !important;
    height: auto !important;
}
/* 增强滚动条 */
.right-panel::-webkit-scrollbar {
    width: 10px;
    background: rgba(240,240,240,0.8);
}
.right-panel::-webkit-scrollbar-thumb {
    background: rgba(0,175,255,0.5);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: content-box;
}
.right-panel::-webkit-scrollbar-thumb:hover {
    background: #00afff;
}
/* 添加滚动条美化样式 */
.right-panel::-webkit-scrollbar {
    width: 8px;
}
.right-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
.right-panel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}
.right-panel::-webkit-scrollbar-thumb:hover {
    background: #555;
}
.pdf-preview {
    position: relative;
    margin: 20px 0;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: auto;
}

.pdf-viewer-container {
    position: relative;
    background: #f8f9fa;
}

.pdf-page {
    position: relative;
    margin: 10px auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

canvas {
    display: block;
    margin: 0 auto;
}

.pdf-loading {
    padding: 20px;
    text-align: center;
    color: #666;
}

.pdf-progress {
    font-weight: bold;
    color: #2b6cb0;
}

.pdf-footer {
    position: sticky;
    bottom: 0;
    padding: 10px 15px;
    background: #fff;
    border-top: 1px solid #e1e1e1;
    display: flex;
    justify-content: flex-end;
}
/* 文章目录样式 */
#toc-container {
top:160px;
position: fixed;
bottom: 20px;
right: 20px;
width: 50px;
height: 50px;
background: #ffffff;
border-radius: 50%;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
display: flex !important;
align-items: center;
justify-content: center;
cursor: pointer;
z-index: 100001;
transition: all 0.3s ease;
/* 新增目录文字样式 */
font-size: 14px;
color: #333;
font-weight: 500;
}

#toc-container::before {
content: "目录";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
white-space: nowrap;
}

#toc-container h3 {
    display: none;
}

#toc-toggle {
right: 0;
padding: 2px 8px;
font-size: 12px;
cursor: pointer;
}

#toc-container.mobile-expanded {
    width: 280px;
    height: 400px;
    border-radius: 10px;
    padding: 5px;
    align-items: flex-start;
    transition: all 0.3s ease;
    pointer-events: auto; /* 允许点击穿透 */
}

#toc-container.mobile-expanded::before {
    content: "目录";
    position: absolute;
    top: 15px;
    left: 25px;
    font-size: 16px;
    font-weight: bold;
}

#toc-list {
    display: none;
    position: relative;
    width: 100%;
    height: calc(100% - 40px);
    margin-top: 35px;
    padding: 0;
}

#toc-container.mobile-expanded #toc-list {
    display: block;
}

.toc-close-btn {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
}
#markdown-render-container p {
    margin: 1em 0;
    line-height: 2.2em;
    font-size: 22px;
}


#markdown-render-container h1 {
    font-size: 2em;  /* 新增字体大小 */
    line-height: 1;  /* 调整行高 */
    margin: 1em 0 0.8em;
    font-weight: 700;
    color: #2c3e50;
    position: relative;
}

#markdown-render-container h2 {
    font-size: 1.6em;  /* 新增字体大小 */
    line-height: 1;
    margin: 1em 0 0.7em;
    font-weight: 600;
    color: #34495e;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 0.3em;
}

#markdown-render-container h3 {
    font-size: 1.5em;  /* 保持原有相对大小 */
    line-height: 1.5;
    margin: 1em 0 0.6em;
    font-weight: 600;
    color: #677389;
    padding-bottom: 0.3em;
}

#markdown-render-container h4 {
    font-size: 1.2em;
    color: #718096;
}

#markdown-render-container h5 {
    font-size: 1em;
    color: #a0aec0;
}

#markdown-render-container h6 {
    font-size: 0.8em;
    color: #cbd5e0;
}
strong {
    font-weight: bold;
    /* font-size: 22px; */
}
/* 代码块基础样式 */
#markdown-render-container pre {
position: relative;
background-color: #d5d5d5;
border-radius: 8px;
padding: 1.5em 2em;
margin: 1.2em 0;
overflow-x: auto;
/* box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); */
counter-reset: line;
font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
font-size: 0.92em;
line-height: 1.5em; 
color: #2c2c2c;
}

/* 代码行样式 */
#markdown-render-container pre code {
display: block;
font-family: inherit;
position: relative;
padding-left: 3.5em;
line-height: 1.5em;
margin: 1em 0;
}

/* 行号样式 */
#markdown-render-container pre code:before {
content: counter(line);
counter-increment: line;
position: absolute;
left: -2.5em;
width: 2.5em;
text-align: right;
color: #666;
padding-right: 1em;
border-right: 1px solid #444;
font-size: 0.9em;
}

/* 代码高亮 */
#markdown-render-container code .hljs-keyword { color: #c678dd; }
#markdown-render-container code .hljs-built_in { color: #e06c75; }
#markdown-render-container code .hljs-string { color: #98c379; }
#markdown-render-container code .hljs-number { color: #d19a66; }
#markdown-render-container code .hljs-comment { color: #5c6370; font-style: italic; }
#markdown-render-container code .hljs-meta { color: #56b6c2; }
#markdown-render-container code .hljs-function { color: #61afef; }

/* 新增文章元信息样式 */
.article-meta-info {
font-size: 12px;
color: rgba(0,0,0,0.4);
}
.article-meta {
margin-top: 20px;
}
.edit-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    margin-left: 10px;
    padding: 2px 5px;
}

.edit-btn:hover {
    color: #1890ff;
    transform: translateY(-1px);
}
/* 通用链接样式 */
.top-bar a {
    text-decoration: none;
}

/* 条件隐藏样式 */
.hidden {
    display: none !important;
}

.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 100000;
}

/* 下拉菜单内容样式 */
.dropdown-content a {
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}
/* 分割线 */
.divider-line {
    width: 100vw;  /* 改为视窗宽度单位 */
    height: 1px;
    background-color: #e0e0e0;
    margin: 20px 0;
    margin-top: 0px;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}
/* 批量操作按钮样式 */
#batch-controls .batch-delete-btn {
    /* 原有样式（如果存在） */
}

.success-btn {
    background-color: #28a745 !important;
}

.warning-btn {
    background-color: #ffc107 !important;
    color: black !important;
}

/* 表单标签样式 */
.form-label {
    font-size: 14px;
    cursor: pointer;
}

/* 复选框样式 */
.select-all-checkbox {
    /* 可添加复选框特定样式 */
}

.CodeMirror {
    height: 500px !important;
    max-height: calc(100% - 45px) !important;
    overflow-y: auto !important;
    z-index: 1;
}

.CodeMirror-scroll {
    z-index: 1;
}

.CodeMirror .CodeMirror-scroll {
    z-index: 1 !important;
}

.CodeMirror .CodeMirror-gutter {
    z-index: 1 !important;
}

.CodeMirror .CodeMirror-lines {
    z-index: 1 !important;
}

.login-modal {
    display: none;
    position: fixed;
    z-index: 100002;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.login-modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 30%;
    border-radius: 8px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.search-results {
    z-index: 1000;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.result-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.result-item:hover {
    background-color: #f5f5f5;
}

.result-type {
    font-size: 0.8em;
    color: #666;
    margin-right: 8px;
}

.match-text {
    background-color: #fff3cd;
    padding: 2px 4px;
    border-radius: 3px;
}



#article-content h2 {
    margin-bottom: 15px;
    color: #333;
}

#article-content h3 {
    margin: 15px 0;
    color: #666;
}

#article-content ul {
    padding-left: 20px;
    margin: 10px 0;
}

#article-content li {
    margin: 5px 0;
    padding: 5px;
    border-bottom: 1px solid #eee;
}

.search-article-link {
    color: #1890ff;
    text-decoration: none;
}

.search-article-link:hover {
    text-decoration: underline;
}

.article-list-controls {
    margin: 10px 0;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
}

.batch-delete-btn {
    padding: 8px 15px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.batch-delete-btn:hover {
    background-color: #c82333;
}

.article-checkbox {
    margin-right: 8px;
    vertical-align: middle;
}

.article-item {
    display: flex;
    align-items: center;
    padding: 5px 0;
}

/* 文章列表表头 */
.article-list-header {
    display: flex;
    padding: 8px 15px;
    background: #f5f5f5;
    border-radius: 4px;
    margin: 10px 0;
    font-weight: bold;
}

.article-title-col {
    flex: 2;
    min-width: 200px;
}

.created-time-col,
.updated-time-col {
    flex: 1;
    min-width: 150px;
}

/* 文章项 */
.article-item .article-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 15px;
    text-decoration: none;
    /* 添加这一行代码以去掉超链接的下划线 */
    color: rgb(0, 0, 0);
}

.article-title {
    flex: 2;
    min-width: 200px;
}

.created-time,
.updated-time {
    flex: 1;
    min-width: 150px;
    font-size: 0.9em;
    color: #666;
}

.edit-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    margin-left: 10px;
    padding: 2px 5px;
}

.edit-btn:hover {
    color: #1890ff;
}

/* 模态框基础样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 100001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}

/* 分类编辑模态框特殊样式 */
#edit-category-modal {
    z-index: 100000;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* 模态框头部 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* 关闭按钮 */
.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #333;
}

/* 表单元素 */
.form-input {
    width: 100%;
    padding: 8px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-select {
    width: 100%;
    padding: 8px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    color: #333;
}

.form-select:focus {
    border-color: #1890ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* 按钮容器 */
.modal-actions {
    margin-top: 20px;
    text-align: right;
}

.btn-primary {
    background: #1890ff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
}

.btn-cancel {
    background: #ddd;
    color: #333;
    border: none;
    padding: 8px 16px;
    margin-left: 10px;
    border-radius: 4px;
    cursor: pointer;
}

.form-select option {
    color: #333 !important;
    background: white !important;
}

.form-select option:disabled {
    color: #999 !important;
    background-color: #f5f5f5 !important;
}

/* 编辑模态框样式 */
#editModal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.edit-modal-content {
    min-width: 400px;
}

/* 登录模态框专用样式 */
#login-modal.modal {
    display: none;
    position: fixed;
    z-index: 100001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

#login-modal .modal-content {
    position: relative;
    background: #fff;
    margin: 10% auto;
    padding: 30px;
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s ease-out;
}

/* 模态框内容区域 */
.modal-content {
    position: relative;
    /* padding: 20px; */
}

/* 表单元素布局 */
.form-group {
    margin-bottom: 15px;
}

/* 文章列表 */
.article-excerpt {
    color: #666;
    font-size: 0.9em;
    line-height: 1.6;
    margin: 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 缩略图模式 */
.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.thumbnail-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.thumbnail-card:hover {
    transform: translateY(-3px);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.default-image {
    height: 200px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
}


.card-title {
    margin: 0;
    font-size: 1.1rem;
}

/* 公共样式 */
.top-tag {
    color: #ff6b6b;
    margin-right: 0.5rem;
}

.empty-tip {
    text-align: center;
    color: #999;
    padding: 3rem 0;
}

/* 横向子分类菜单样式 */
.subcategory-menu {
    margin: 2rem 0;
    overflow-x: auto;
}

.subcategory-list {
    display: flex;
    gap: 1.5rem;
    padding-bottom: 1rem;
    flex-wrap: nowrap;
}

.subcategory-item {
    /* flex: 0 0 280px; */
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(130, 130, 130, 0.1);
    transition: transform 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.subcategory-item:hover {
    transform: translateY(-4px);
}

.subcategory-inner {
    padding: 1.5rem;
}

.subcategory-thumbnail {
    position: relative;
    padding-bottom: 56.25%;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.subcategory-thumbnail img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.subcategory-content h3 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    color: #333;
}

.subcategory-content .meta {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* 统一输入框样式 */
.form-control {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.button-group {
    margin-top: 20px;
    text-align: right;
}

.btn-save {
    background: #4CAF50;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-cancel {
    background: #666;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
}



#new-cate {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    color: #333;
}

#new-cate option {
    padding: 5px;
    margin: 2px 0;
    background: #f5f5f5;
    border-radius: 3px;
}

#new-cate option:checked {
    background: #1890ff;
    color: white;
}

#editArticleCate option {
    padding-left: 10px;
    line-height: 1.5;
}

#editArticleCate option[selected] {
    background-color: #e6f7ff;
    font-weight: 500;
}


#new-editor-container {
    height: calc(100% - 180px);
    position: relative;
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

#new-editor-md-container {
    height: 100% !important;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}

.editormd-preview {
    top: 80px !important;
}

/* 添加错误显示样式 */
.loading {
    padding: 20px;
    color: #666;
    text-align: center;
}

.error-alert {
    padding: 20px;
    background: #ffe6e6;
    border: 1px solid #ff4444;
    border-radius: 4px;
    margin: 20px;
}

.error-alert h3 {
    color: #dc3545;
    margin-bottom: 10px;
}

.error-alert button {
    margin-top: 10px;
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* 分销团队样式 */
.team-container {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.team-level {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.team-level h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.team-level ul {
    list-style: none;
    padding-left: 20px;
}

.team-level li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.join-time {
    color: #7f8c8d;
    font-size: 0.9em;
}

.commission-summary {
    background: #3498db;
    color: white;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.commission-summary h3 {
    margin: 0 0 10px 0;
}

/* 置顶文章特殊样式 */
.article-item--top {
    font-weight: bold;
    color: #007bff;
    order: -1;
}

    /* 列表模式 */
.article-list {
    max-width: 800px;
    margin: 0 auto;
}
.list-title {
    font-size: 1.8rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
}

.list-item {
    display: flex;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.list-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}
.item-thumbnail {
    width: 220px;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 1.5rem;
}

.item-content {
    flex: 1;
}

.item-title {
    font-size: 1.3rem;
    margin: 0 0 0.8rem;
}

.item-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* 列表项基础样式 */
.article-item {
    margin: 5px 0;
}

/* 添加按钮样式 */
.batch-delete-btn {
    margin-right: 10px;
    /* 给右边按钮添加间距 */
}

/* 保持原有样式基础上，可以调整颜色 */
button[onclick="batchTopArticles()"] {
    background-color: #28a745 !important;
}

/* 文章编辑页样式 */
#editor-container {
    position: relative;
    z-index: 999;
    background: white;
    margin: 20px;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    /* 添加这个属性来启用垂直滚动条 */
    max-height: calc(100vh);
    /* 根据实际情况调整最大高度 */
}

.action-buttons {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}

.btn-save,
.btn-publish {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-save {
    background: #4CAF50;
    color: white;
}

.btn-publish {
    background: #2196F3;
    color: white;
}

.btn-save:hover,
.btn-publish:hover {
    opacity: 0.9;
}

/* 调整折叠按钮的悬停效果 */
#toc-toggle:hover {
    background: #e0e0e0;
}

.visibility-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
    background: white;
    color: #333;
}

/* 添加置顶按钮样式 */
.btn-top {
    background: #666;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
    margin-left: 10px;
}

.btn-top:hover {
    background: #555;
}

.btn-top i {
    margin-right: 5px;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, .3);
    border-radius: 50%;
    border-top-color: #000;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 添加toast样式 */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 4px;
    background: #333;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s;
}

.toast.success {
    background: #4CAF50;
}

.toast.error {
    background: #f44336;
}

/* 新建文章页样式 */
#new-article-form {
    display: none;
    margin-bottom: 10px;
    height: calc(100vh - 100px);
    overflow-y: auto;
    position: relative;
    background: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 加载更多按钮样式 */
.modern-load-btn {
    margin: 25px auto;
    display: block;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #4a90e2, #2f80ed);
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modern-load-btn:hover {
    background: linear-gradient(135deg, #63a4ff, #2f80ed);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.modern-load-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 到底啦 */
.modern-load-btn.disabled {
    background: linear-gradient(135deg, #cccccc, #999999);
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

.modern-load-btn.disabled:hover {
    transform: none;
}

.secret-badge {
    font-size: 0.8em;
    color: #ff4d4d;
    margin-left: 5px;
}



/* 分类内容展示样式 */
.category-content-display {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
    margin-top: 15px;
    line-height: 1.6;
    font-size: 15px;
}

.category-content-display img {
    max-width: 100%;
    height: auto;
    margin: 15px 0;
    border-radius: 4px;
}

.category-content-display h2,
.category-content-display h3 {
    margin: 25px 0 15px;
    color: #2c3e50;
}

.no-content-hint {
    color: #6c757d;
    padding: 20px;
    text-align: center;
    background: #fdfdfd;
    border: 1px dashed #dee2e6;
    border-radius: 6px;
}

/* 表格基础样式 */
    .markdown-table {
        width: 100%;
        border-collapse: collapse;
        margin: 1em 0;
        font-size: 0.9em;
        font-family: sans-serif;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
    }
    
    .markdown-table thead tr {
        background-color: #009879;
        color: #ffffff;
        text-align: left;
    }
    
    .markdown-table th,
    .markdown-table td {
        padding: 12px 15px;
        border: 1px solid #dddddd;
    }
    
    .markdown-table tbody tr {
        border-bottom: 1px solid #dddddd;
    }
    
    .markdown-table tbody tr:nth-of-type(even) {
        background-color: #f3f3f3;
    }
    
    .markdown-table tbody tr:last-of-type {
        border-bottom: 2px solid #009879;
    }
    
    /* 对齐样式 */
    .align-left {
        text-align: left;
    }
    
    .align-center {
        text-align: center;
    }
    
    .align-right {
        text-align: right;
    }

/* 响应式处理 */
@media (max-width: 768px) {
    article, 
    #markdown-render-container,
    .article-title-wrapper {
        max-width: 100% !important;
        margin: 0 0 !important;
    }

    /* 表格样式 */
    .markdown-table {
        font-size: 14px;
    }
    
    .markdown-table th,
    .markdown-table td {
        padding: 8px 10px;
    }

    .subcategory-item {
        flex: 0 0 80%;
    }
    
    .subcategory-list {
        gap: 1rem;
        padding: 0 1rem 1rem;
    }

    .slider-item img {
        max-height: 300px; /* 移动端适当减小高度 */
    }
    
    .category-container {
        position: sticky;
        top: 0;
    }

    /* 登录模态框界面 */
    #login-modal .modal-content {
        margin: 20% auto;
        width: 90%;
    }
    
    #login-modal .modal-actions {
        flex-direction: column;
    }


    .top-panel {
        flex-direction: column;
        /* 手机端改为垂直布局 */
        align-items: stretch;
        padding: 5px;
    }

    .search-container {
        width: 100%;
        /* 手机端填满宽度 */
        margin: 5px 0 0 0;
        /* 调整间距 */
    }

    .top-panel.active {
        display: block;
    }

    .main-panel {
        margin-top: 0;
        height: 100%;
    }

    /* 调整下拉菜单定位 */
    #new-doc-dropdown {
        position: fixed;
        bottom: 60px;
        left: 20px;
        z-index: 100000;
        display: block !important;
    }

    .new-doc-btn {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        font-size: 24px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        background: #4CAF50;
        color: white;
    }

    .dropdown-content {
        /* position: fixed; */
        bottom: 80px;
        /* right: 20px; */
        top: auto !important;
        /* width: 50px; */
        /* min-width: 120px; */
        transform: none !important;
        /* box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); */
    }

    .dropdown-content a {
        padding: 15px;
        font-size: 14px;
    }



.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* 确保容器至少占满整个视口高度 */
    position: relative;
}

    .right-panel {
        resize: none;
    }


    #article-content {
        padding: 10px;
    }

    #article-content>span {
        display: block;
        padding: 10px 5px;
        font-size: 16px;
    }

    .article-list-controls {
        flex-direction: column;
        gap: 8px;
        padding: 8px;
    }



    #select-all-articles {
        margin: 10px 0;
        display: block;
    }

    .article-item {
        position: relative;
        padding-left: 30px;
        /* 为checkbox留出空间 */
    }

    .article-checkbox {
        position: absolute;
        left: 0px;
        top: 50%;
        transform: translateY(-50%);
        margin: 0;
        width: 12px;
        height: 12px;
    }

    /* 调整文章链接的间距 */
    .article-link {
        flex-direction: column;
        align-items: flex-start !important;
        /* 强制左对齐 */
        padding: 8px 5px !important;
    }

    .article-title {
        flex: 1 0 100%;
        /* 允许元素扩展填充剩余空间 */
        font-size: 14px;
        margin-bottom: 5px;
        text-align: left;
        /* 新增左对齐 */
        padding-left: 8px;
        /* 添加左侧内边距 */
    }

    .created-time {
        flex: 0 0 50%;
        font-size: 12px;
        min-width: auto;
        display: none;
        /* 新增隐藏属性 */
    }

    .updated-time {
        flex: 1 0 100%;
        /* 改为全宽度 */
        font-size: 12px;
        color: #bbbbbb;
        text-align: left;
        /* 新增左对齐 */
        padding-left: 8px;
        /* 与标题对齐 */
        min-width: auto;
        text-align: left;
        /* 新增左对齐 */
        padding-left: 8px;
        /* 与标题对齐 */
        margin-top: -3px;
        /* 调整与标题的间距 */
    }

    #load-more.modern-load-btn {
        width: 90%;
        margin: 15px auto;
        padding: 10px;
        font-size: 14px;
    }

    .article-list-header {
        flex-wrap: wrap;
        padding: 5px;
    }

    .article-title-col,
    .created-time-col,
    .updated-time-col {
        flex: 0 0 100%;
        padding: 3px 0;
    }

    .buttons-container {
        margin: 0 !important;
        /* 清除原有margin */
        margin-left: auto !important;
        /* 强制右对齐 */
        width: auto;
        /* 自适应宽度 */
        flex-wrap: nowrap;
        /* 防止换行 */
        justify-content: flex-end;
        /* 右对齐 */
    }

    .markdown-editor {
        height: calc(100% - 60px);
    }

    .divider {
        display: none;
    }
}


#editor-md-container {
    height: calc(100% - 45px);
    background: #fff;
}

.editormd-fullscreen {
    z-index: 100001;
}