body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f5f6fb;
    color: #233042;
}

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #1b6dc1;
    color: #fff;
    padding: 8px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.top-bar nav a {
    color: #fff;
    margin-left: 12px;
    text-decoration: none;
    font-size: 14px;
}

.container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    margin-top: 48px;
    background: #fff;
    padding: 24px 32px;
    border-radius: 0;
    box-shadow: none;
}

.footer {
    text-align: center;
    margin: 32px 0;
    color: #666;
}

/* 登录页面居中布局 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 40px 20px;
}

.login-box {
    width: 100%;
    max-width: 480px;
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Markdown内容样式 */
.markdown-content {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
    color: #24292e;
}

.markdown-content h1 {
    font-size: 2em;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3em;
}

.markdown-content h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3em;
}

.markdown-content h3 {
    font-size: 1.25em;
}

.markdown-content h4 {
    font-size: 1em;
}

.markdown-content p {
    margin-bottom: 16px;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 16px;
    padding-left: 2em;
}

.markdown-content li {
    margin-bottom: 4px;
}

.markdown-content code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 3px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.markdown-content pre {
    padding: 16px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background-color: #f6f8fa;
    border-radius: 6px;
    margin-bottom: 16px;
}

.markdown-content pre code {
    display: inline;
    max-width: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    line-height: inherit;
    word-wrap: normal;
    background-color: transparent;
    border: 0;
}

.markdown-content blockquote {
    padding: 0 1em;
    color: #6a737d;
    border-left: 0.25em solid #dfe2e5;
    margin-bottom: 16px;
}

.markdown-content table {
    border-spacing: 0;
    border-collapse: collapse;
    margin-bottom: 16px;
    width: 100%;
}

.markdown-content table th,
.markdown-content table td {
    padding: 6px 13px;
    border: 1px solid #dfe2e5;
}

.markdown-content table th {
    font-weight: 600;
    background-color: #f6f8fa;
}

.markdown-content table tr:nth-child(2n) {
    background-color: #f6f8fa;
}

.markdown-content a {
    color: #0366d6;
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 16px 0;
}

.markdown-content hr {
    height: 0.25em;
    padding: 0;
    margin: 24px 0;
    background-color: #e1e4e8;
    border: 0;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    background: #1b6dc1;
    color: #fff;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

th, td {
    border: 1px solid #e5e7eb;
    padding: 8px;
}

form input, form textarea, form select {
    width: 100%;
    padding: 8px;
    margin-bottom: 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
}

.messages {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.messages li {
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #e0f2fe;
}

/* Markdown 内容样式 */
.markdown-content {
    line-height: 1.6;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 16px;
    margin-bottom: 8px;
    font-weight: bold;
}

.markdown-content h1 { font-size: 1.5em; border-bottom: 2px solid #e5e7eb; padding-bottom: 4px; }
.markdown-content h2 { font-size: 1.3em; border-bottom: 1px solid #e5e7eb; padding-bottom: 4px; }
.markdown-content h3 { font-size: 1.1em; }
.markdown-content h4 { font-size: 1em; }
.markdown-content h5 { font-size: 0.9em; }
.markdown-content h6 { font-size: 0.85em; }

.markdown-content p {
    margin: 8px 0;
}

.markdown-content ul,
.markdown-content ol {
    margin: 8px 0;
    padding-left: 24px;
}

.markdown-content li {
    margin: 4px 0;
}

.markdown-content code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

.markdown-content pre {
    background: #f3f4f6;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 12px 0;
    border: 1px solid #e5e7eb;
}

.markdown-content pre code {
    background: none;
    padding: 0;
    color: #233042;
    font-size: 0.9em;
}

.markdown-content blockquote {
    border-left: 4px solid #1b6dc1;
    padding-left: 16px;
    margin: 12px 0;
    color: #666;
    font-style: italic;
}

.markdown-content table {
    border-collapse: collapse;
    margin: 12px 0;
    width: 100%;
}

.markdown-content table th,
.markdown-content table td {
    border: 1px solid #e5e7eb;
    padding: 8px;
    text-align: left;
}

.markdown-content table th {
    background: #f3f4f6;
    font-weight: bold;
}

.markdown-content a {
    color: #1b6dc1;
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 8px 0;
}

.markdown-content hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 16px 0;
}

.markdown-content strong {
    font-weight: bold;
}

.markdown-content em {
    font-style: italic;
}

/* 主题收拢/展开功能样式 */
.thread-toggle-btn {
    transition: background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.thread-toggle-btn:hover {
    background-color: #5a6268 !important;
}

.thread-content {
    transition: opacity 0.3s ease, max-height 0.3s ease;
    overflow: hidden;
    opacity: 1;
    max-height: 10000px;
    display: block;
}

.thread-content.collapsed {
    opacity: 0;
    max-height: 0;
    display: none !important;
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.2s ease;
    margin-left: 4px;
    font-size: 10px;
}

/* 项目详情页面侧边栏布局 */
.project-detail-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.project-main-content {
    flex: 1;
    min-width: 0;
    /* 主内容区域占据剩余空间，包含项目信息和讨论区 */
}

.project-sidebar {
    flex: 0 0 280px; /* 固定宽度280px，不伸缩 */
    position: sticky;
    top: 100px; /* 根据顶部导航栏高度调整，top-bar大约60-80px�?*/
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    /* 添加滚动条样�?*/
    scrollbar-width: thin;
    scrollbar-color: #ccc #f5f5f5;
}

.project-sidebar::-webkit-scrollbar {
    width: 6px;
}

.project-sidebar::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.project-sidebar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.project-sidebar::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.sidebar-sticky {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-right: 0;
}

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

.thread-item {
    margin-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 12px;
}

.thread-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.thread-link {
    display: block;
    text-decoration: none;
    color: #333;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
}

.thread-link:hover {
    background-color: #f5f5f5;
    color: #1b6dc1;
    transform: translateX(4px);
}

.thread-link.active {
    background-color: #e3f2fd;
    border-left: 3px solid #1b6dc1;
    padding-left: 13px;
}

.thread-title {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 6px;
    color: #233042;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.thread-link:hover .thread-title {
    color: #1b6dc1;
}

.thread-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.thread-author {
    color: #666;
}

.thread-replies {
    color: #1b6dc1;
    font-weight: 500;
}

.thread-time {
    font-size: 11px;
    color: #999;
}

/* 粘贴图片预览样式 */
.paste-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.paste-preview-container img {
    max-width: 200px;
    max-height: 150px;
    border: 1px solid #ddd;
    border-radius: 4px;
    object-fit: contain;
}

.remove-paste-image {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.remove-paste-image:hover {
    background: rgba(255, 0, 0, 1);
}

/* 表情面板样式 */
.emoji-panel {
    position: absolute;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    max-width: 300px;
    max-height: 250px;
    overflow-y: auto;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
}

.emoji-item {
    background: none;
    border: none;
    font-size: 20px;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
}

.emoji-item:hover {
    background-color: #f0f0f0;
}

.emoji-btn {
    position: absolute;
    right: 8px;
    top: 8px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.2s;
}

.emoji-btn:hover {
    background-color: #e0e0e0;
}

/* 响应式设计：小屏幕时侧边栏移到下�?*/
@media (max-width: 968px) {
    .project-detail-layout {
        flex-direction: column;
    }
    
    .project-sidebar {
        flex: 0 0 auto;
        position: static;
        width: 100%;
        max-height: none;
        top: auto;
    }
    
    .sidebar-sticky {
        margin-right: 0;
    }
}




.thread-time {
    font-size: 11px;
    color: #999;
}

/* 粘贴图片预览样式 */
.paste-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.paste-preview-container img {
    max-width: 200px;
    max-height: 150px;
    border: 1px solid #ddd;
    border-radius: 4px;
    object-fit: contain;
}

.remove-paste-image {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.remove-paste-image:hover {
    background: rgba(255, 0, 0, 1);
}

/* 表情面板样式 */
.emoji-panel {
    position: absolute;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    max-width: 300px;
    max-height: 250px;
    overflow-y: auto;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
}

.emoji-item {
    background: none;
    border: none;
    font-size: 20px;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
}

.emoji-item:hover {
    background-color: #f0f0f0;
}

.emoji-btn {
    position: absolute;
    right: 8px;
    top: 8px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.2s;
}

.emoji-btn:hover {
    background-color: #e0e0e0;
}

/* 响应式设计：小屏幕时侧边栏移到下�?*/
@media (max-width: 968px) {
    .project-detail-layout {
        flex-direction: column;
    }
    
    .project-sidebar {
        flex: 0 0 auto;
        position: static;
        width: 100%;
        max-height: none;
        top: auto;
    }
    
    .sidebar-sticky {
        margin-right: 0;
    }
}





/* Quill富文本编辑器样式 */
.ql-container { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border: 1px solid #ccc; border-top: none; }
.ql-editor { min-height: 200px; }
.ql-toolbar { border-top-left-radius: 4px; border-top-right-radius: 4px; border: 1px solid #ccc; background: #fafafa; }
.ql-editor.ql-blank::before { color: #999; font-style: normal; }
.ql-snow .ql-stroke { stroke: #666; }
.ql-snow .ql-fill { fill: #666; }
.ql-snow .ql-picker-label { color: #666; }
.ql-snow .ql-picker-options { background: white; border: 1px solid #ccc; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }


/* EPUB转HTML显示样式 */
.epub-content {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    max-width: none;
}

.epub-chapter-anchor {
    padding-top: 80px;
    margin-top: -80px;
    visibility: hidden;
    position: relative;
}

.epub-chapter-anchor:hover {
    visibility: visible;
}

.epub-chapter-anchor::before {
    content: '📍';
    position: absolute;
    top: 5px;
    left: -20px;
    font-size: 12px;
    opacity: 0.5;
}

.epub-content h1, .epub-content h2, .epub-content h3,
.epub-content h4, .epub-content h5, .epub-content h6 {
    color: #2c3e50;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.epub-content h1 { font-size: 2em; border-bottom: 2px solid #3498db; padding-bottom: 0.3em; }
.epub-content h2 { font-size: 1.6em; border-bottom: 1px solid #bdc3c7; padding-bottom: 0.2em; }
.epub-content h3 { font-size: 1.4em; }
.epub-content h4 { font-size: 1.2em; }
.epub-content h5 { font-size: 1.1em; }
.epub-content h6 { font-size: 1em; }

.epub-chapter-title {
    color: #2c3e50;
    font-size: 1.4em;
    margin: 2em 0 1em 0;
    padding: 0.5em 0;
    border-bottom: 1px solid #ecf0f1;
    font-weight: 600;
}

.epub-content p {
    margin: 1em 0;
    text-align: justify;
}

.epub-content blockquote {
    border-left: 4px solid #3498db;
    padding-left: 1em;
    margin: 1.5em 0;
    color: #555;
    font-style: italic;
}

.epub-content ul, .epub-content ol {
    margin: 1em 0;
    padding-left: 2em;
}

.epub-content li {
    margin: 0.5em 0;
}

.epub-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
    background: #fff;
}

.epub-content th, .epub-content td {
    border: 1px solid #bdc3c7;
    padding: 8px 12px;
    text-align: left;
}

.epub-content th {
    background: #f8f9fa;
    font-weight: 600;
}

.epub-content img {
    max-width: 100%;
    height: auto;
    margin: 1em 0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.epub-content a {
    color: #3498db;
    text-decoration: none;
}

.epub-content a:hover {
    text-decoration: underline;
}

/* EPUB目录样式 */
.epub-toc {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
}

.epub-toc-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.epub-toc-list li {
    margin: 2px 0;
}

.epub-toc h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    position: sticky;
    top: 0;
    background: #f8f9fa;
    padding: 5px 0;
    border-bottom: 1px solid #e9ecef;
}

.epub-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.epub-toc-list li {
    margin: 5px 0;
    line-height: 1.4;
}

.epub-toc-list a {
    color: #34495e;
    text-decoration: none;
    display: block;
    padding: 3px 5px;
    border-radius: 3px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.epub-toc-list a:hover {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
    border-left-color: #3498db;
    transform: translateX(2px);
}

.toc-level-0 {
    font-weight: 600;
    font-size: 15px;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 5px;
    padding-bottom: 3px;
}
.toc-level-1 {
    padding-left: 15px;
    font-size: 14px;
    font-weight: 500;
}
.toc-level-2 {
    padding-left: 30px;
    font-size: 13px;
    color: #555;
}
.toc-level-3 {
    padding-left: 45px;
    font-size: 12px;
    color: #666;
}
.toc-level-4 {
    padding-left: 60px;
    font-size: 11px;
    color: #777;
}
.toc-level-5,
.toc-level-6,
.toc-level-7 {
    padding-left: 75px;
    font-size: 11px;
    color: #888;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .epub-content {
        font-size: 14px;
    }

    .epub-content h1 { font-size: 1.6em; }
    .epub-content h2 { font-size: 1.4em; }
    .epub-content h3 { font-size: 1.2em; }
}