/* 文档中心样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.docs-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ==================== 左侧边栏 ==================== */
.docs-sidebar {
    width: 320px;
    background: #fff;
    border-right: 1px solid #e4e7ed;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #e4e7ed;
    background: #3B82F6;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .back-arrow {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.sidebar-header .back-arrow:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(-2px);
}

.sidebar-header .back-arrow:active {
    transform: translateX(0);
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    flex: 1;
}

.docs-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.docs-list {
    list-style: none;
}

.doc-item {
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.doc-item:hover {
    background: #f5f7fa;
}

.doc-item.active {
    background: #ecf5ff;
    border-left-color: #409eff;
}

.doc-item.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: #409eff;
    border-radius: 2px 0 0 2px;
}

.doc-item-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.doc-item-title {
    font-size: 15px;
    font-weight: 500;
    color: #303133;
    line-height: 1.4;
}

.doc-item.active .doc-item-title {
    color: #409eff;
    font-weight: 600;
}

.doc-item-subtitle {
    font-size: 13px;
    color: #909399;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.doc-item-empty {
    padding: 40px 20px;
    text-align: center;
    color: #909399;
}

/* 滚动条样式 */
.docs-nav::-webkit-scrollbar {
    width: 6px;
}

.docs-nav::-webkit-scrollbar-track {
    background: transparent;
}

.docs-nav::-webkit-scrollbar-thumb {
    background: #dcdfe6;
    border-radius: 3px;
}

.docs-nav::-webkit-scrollbar-thumb:hover {
    background: #c0c4cc;
}

/* ==================== 右侧内容区 ==================== */
.docs-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}

.content-header {
    padding: 16px 32px;
    border-bottom: 1px solid #e4e7ed;
    background: #fff;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #606266;
}

.breadcrumb a {
    color: #409eff;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: #66b1ff;
}

.breadcrumb .separator {
    color: #c0c4cc;
}

.breadcrumb .current {
    color: #303133;
    font-weight: 500;
}

.content-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px 48px 80px;
}

/* 文档文章样式 */
.doc-article {
    max-width: 900px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.doc-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e4e7ed;
}

.doc-title {
    font-size: 32px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 12px;
    line-height: 1.3;
}

.doc-subtitle {
    font-size: 18px;
    color: #606266;
    margin-bottom: 16px;
    line-height: 1.5;
}

.doc-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    color: #909399;
}

.doc-type {
    padding: 4px 12px;
    background: #f0f2f5;
    border-radius: 4px;
    font-size: 13px;
}

.doc-update-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 文档内容样式 */
.doc-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 32px;
}

.doc-content h1,
.doc-content h2,
.doc-content h3,
.doc-content h4,
.doc-content h5,
.doc-content h6 {
    margin-top: 32px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: #303133;
}

.doc-content h1 {
    font-size: 28px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e4e7ed;
}

.doc-content h2 {
    font-size: 24px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e4e7ed;
}

.doc-content h3 {
    font-size: 20px;
}

.doc-content h4 {
    font-size: 18px;
}

.doc-content p {
    margin-bottom: 16px;
}

.doc-content ul,
.doc-content ol {
    margin-bottom: 16px;
    padding-left: 28px;
}

.doc-content li {
    margin-bottom: 8px;
}

.doc-content a {
    color: #409eff;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s;
}

.doc-content a:hover {
    border-bottom-color: #409eff;
}

.doc-content code {
    padding: 2px 8px;
    background: #f5f7fa;
    border: 1px solid #e4e7ed;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    color: #e83e8c;
}

.doc-content pre {
    background: #f5f7fa;
    border: 1px solid #e4e7ed;
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.doc-content pre code {
    padding: 0;
    background: none;
    border: none;
    color: #333;
    font-size: 14px;
}

.doc-content blockquote {
    margin: 16px 0;
    padding: 12px 20px;
    background: #f0f9ff;
    border-left: 4px solid #409eff;
    color: #606266;
}

.doc-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.doc-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 15px;
}

.doc-content table th,
.doc-content table td {
    padding: 12px;
    border: 1px solid #e4e7ed;
    text-align: left;
}

.doc-content table th {
    background: #f5f7fa;
    font-weight: 600;
    color: #303133;
}

.doc-content table tr:hover {
    background: #fafafa;
}

/* 文档提示区域 */
.doc-tips {
    background: #fff9e6;
    border: 1px solid #ffe58f;
    border-radius: 8px;
    padding: 20px 24px;
    margin-top: 32px;
}

.doc-tips h3 {
    font-size: 18px;
    color: #faad14;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.doc-tips ul {
    list-style: none;
    padding-left: 0;
}

.doc-tips li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    color: #666;
}

.doc-tips li::before {
    content: '•';
    position: absolute;
    left: 8px;
    color: #faad14;
    font-weight: bold;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h2 {
    font-size: 24px;
    color: #606266;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 16px;
    color: #909399;
}

/* 加载状态 */
.loading-state {
    text-align: center;
    padding: 80px 20px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #409eff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-state p {
    font-size: 16px;
    color: #909399;
}

/* 错误状态 */
.error-state {
    text-align: center;
    padding: 80px 20px;
}

.error-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.error-state h2 {
    font-size: 24px;
    color: #f56c6c;
    margin-bottom: 12px;
}

.error-state p {
    font-size: 16px;
    color: #909399;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    right: 40px;
    bottom: 40px;
    width: 48px;
    height: 48px;
    background: #409eff;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(64, 158, 255, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #66b1ff;
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(64, 158, 255, 0.4);
}

.back-to-top:active {
    transform: translateY(-2px);
}

/* 内容区域滚动条 */
.content-body::-webkit-scrollbar {
    width: 8px;
}

.content-body::-webkit-scrollbar-track {
    background: #f5f7fa;
}

.content-body::-webkit-scrollbar-thumb {
    background: #c0c4cc;
    border-radius: 4px;
}

.content-body::-webkit-scrollbar-thumb:hover {
    background: #909399;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .docs-sidebar {
        width: 280px;
    }
    
    .content-body {
        padding: 24px 32px 60px;
    }
    
    .doc-title {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .docs-container {
        flex-direction: column;
    }
    
    .docs-sidebar {
        width: 100%;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid #e4e7ed;
    }
    
    .content-body {
        padding: 20px 16px 60px;
    }
    
    .doc-title {
        font-size: 24px;
    }
    
    .doc-subtitle {
        font-size: 16px;
    }
    
    .doc-content {
        font-size: 15px;
    }
    
    .back-to-top {
        right: 20px;
        bottom: 20px;
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}

/* 打印样式 */
@media print {
    .docs-sidebar,
    .breadcrumb,
    .back-to-top {
        display: none;
    }
    
    .docs-content {
        width: 100%;
    }
    
    .doc-content {
        font-size: 12pt;
    }
}

