* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f3ff; /* 非常淡的紫色背景 */
    min-height: 100vh;
    color: #333;
    display: flex;
    flex-direction: column;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #667eea;
    font-size: 28px;
}

.login-form {
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.error-message {
    background-color: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
}

.btn-login, .btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-login:hover, .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* 导航栏样式 */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.nav-logo {
    color: #667eea;
    font-size: 24px;
    margin: 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 20px;
    margin: 0;
}

.nav-link {
    text-decoration: none;
    color: #555;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s;
}

.nav-link:hover, .nav-link.active {
    background: #667eea;
    color: white;
}

.nav-user {
    color: #667eea;
    font-weight: 500;
}

/* 内容容器 */
.content-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.welcome-section {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    text-align: center;
}

.welcome-section h1 {
    color: #667eea;
    margin-bottom: 15px;
}

.welcome-section p {
    color: #666;
    font-size: 18px;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.card h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.card p {
    color: #666;
    line-height: 1.6;
}

.page-content {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.page-content h1 {
    color: #667eea;
    margin-bottom: 20px;
}

.page-content p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 15px;
}

.settings-form {
    max-width: 500px;
    margin-top: 30px;
}

.settings-form .form-group {
    margin-bottom: 20px;
}

.settings-form .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.settings-form .form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
}

.settings-form .form-group input[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* ICP备案号样式 */
.icp-footer {
    text-align: center;
    margin-top: auto;
    padding: 8px 0;
    width: 100%;
    flex-shrink: 0;
}

.icp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    line-height: 1.2;
}

.icp-container a {
    color: #666; /* 深灰色，在淡紫色背景上清晰可见 */
    text-decoration: none;
    font-size: 12px;
    transition: color 0.3s;
    display: inline-block;
}

.icp-container a:hover {
    color: #667eea; /* 悬停时变为主题紫色 */
    text-decoration: underline;
}

.icp-separator {
    color: #999; /* 灰色分隔符 */
    margin: 0 10px;
}

/* 文档浏览页面样式 */
.documents-container {
    display: flex;
    height: calc(100vh - 70px); /* 减去navbar高度 */
    margin-top: 0;
    background: #faf9ff; /* 非常淡的紫色背景 */
    position: relative;
    top: 0;
    align-items: flex-start; /* 确保左右分栏从顶部对齐 */
}

.documents-sidebar {
    width: 300px;
    background: #ffffff; /* 白色背景，与淡紫色形成对比 */
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    align-self: stretch; /* 确保与主内容区域高度一致 */
    height: 100%; /* 填满容器高度 */
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff; /* 白色背景，与淡紫色形成对比 */
}

.sidebar-header h2 {
    margin: 0;
    color: #667eea;
    font-size: 20px;
}

.refresh-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.refresh-btn:hover {
    background: #5568d3;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
    min-height: 0; /* 确保可以滚动 */
    background: #ffffff; /* 白色背景 */
}

.documents-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.document-item {
    margin: 0;
    padding: 0;
}

.document-item a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.3s;
    word-break: break-word;
}

.document-item a:hover {
    background: #e8eaf6;
    border-left-color: #667eea;
}

.document-item.active a {
    background: #667eea;
    color: white;
    border-left-color: #5568d3;
}

.no-files {
    padding: 20px;
    text-align: center;
    color: #999;
}

.documents-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #faf9ff; /* 非常淡的紫色背景 */
    align-self: stretch; /* 确保与侧边栏高度一致 */
    height: 100%; /* 填满容器高度 */
}

.main-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    background: #ffffff; /* 白色背景，与淡紫色形成对比 */
}

.main-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    background: #faf9ff; /* 非常淡的紫色背景 */
    min-height: 0; /* 确保可以滚动 */
    align-self: stretch; /* 确保与侧边栏高度一致 */
}

.document-content {
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff; /* 白色背景，确保文字清晰 */
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 18px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #667eea;
}

.markdown-body {
    line-height: 1.8;
    color: #333;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
    color: #333;
}

.markdown-body h1 {
    font-size: 2em;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3em;
}

.markdown-body h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3em;
}

.markdown-body h3 {
    font-size: 1.25em;
}

.markdown-body p {
    margin-bottom: 16px;
}

.markdown-body ul,
.markdown-body ol {
    margin-bottom: 16px;
    padding-left: 2em;
}

.markdown-body li {
    margin-bottom: 8px;
}

.markdown-body code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

.markdown-body pre {
    background: #f6f8fa;
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.markdown-body pre code {
    background: transparent;
    padding: 0;
    color: #333;
    font-size: 0.9em;
}

.markdown-body blockquote {
    border-left: 4px solid #dfe2e5;
    padding: 0 16px;
    color: #6a737d;
    margin-bottom: 16px;
}

.markdown-body table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 16px;
}

.markdown-body table th,
.markdown-body table td {
    border: 1px solid #dfe2e5;
    padding: 6px 13px;
}

.markdown-body table th {
    background: #f6f8fa;
    font-weight: 600;
}

.markdown-body a {
    color: #667eea;
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}

.markdown-body img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 16px 0;
}

/* 目录样式 */
.table-of-contents {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px 20px;
    margin-bottom: 30px;
}

.toc-header {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin: 6px 0;
    line-height: 1.6;
}

.toc-link {
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s;
    display: block;
}

.toc-level-1 .toc-link {
    font-size: 15px;
    color: #667eea;
}

.toc-level-2 .toc-link {
    font-size: 13px;
    color: #7c8ae8;
}

.toc-level-3 .toc-link {
    font-size: 11px;
    color: #9aa5f0;
}

.toc-link:hover {
    color: #5568d3;
    text-decoration: underline;
}

.toc-level-1 {
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

.toc-level-2 {
    font-weight: 500;
    font-size: 13px;
    color: #555;
}

.toc-level-3 {
    font-weight: 400;
    font-size: 11px;
    color: #777;
}

/* 标题锚点样式 */
.markdown-body h1[id],
.markdown-body h2[id],
.markdown-body h3[id] {
    scroll-margin-top: 20px;
    position: relative;
}

.markdown-body h1[id]:hover::before,
.markdown-body h2[id]:hover::before,
.markdown-body h3[id]:hover::before {
    content: '🔗';
    position: absolute;
    left: -25px;
    font-size: 14px;
    opacity: 0.5;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .login-box {
        padding: 30px 20px;
    }
    
    .cards-container {
        grid-template-columns: 1fr;
    }
    
    .icp-container a {
        font-size: 12px;
    }
    
    .documents-container {
        flex-direction: column;
        height: auto;
    }
    
    .documents-sidebar {
        width: 100%;
        max-height: 300px;
    }
    
    .documents-main {
        height: calc(100vh - 360px);
    }
}

