:root {
    --primary: #0077FF;
    --primary-light: #e6f2ff;
    --primary-dark: #0055cc;
    --text: #333333;
    --text-secondary: #666666;
    --text-muted: #729fb2;
    --bg: #ffffff;
    --bg-secondary: #f5f7fa;
    --bg-sidebar: #f8f9fb;
    --border: #e5e7eb;
    --border-light: #f0f0f0;
    --code-bg: #f6f8fa;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --radius: 8px;
    --radius-sm: 6px;
}

/* 顶部导航 */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    font-size: 18px;
    text-decoration: none;
    color: #333;
}



/* 搜索框 */
.search-box {
    position: relative;
    width: 320px;
}

.search-input {
    width: 100%;
    height: 38px;
    padding: 0 16px 0 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text);
    transition: all 0.2s ease;
}

    .search-input:focus {
        outline: none;
        border-color: var(--primary);
        background: #fff;
        box-shadow: 0 0 0 3px var(--primary-light);
    }

.search-icon {
    display: inline-block;
    position: absolute;
    left: 14px;
    top: calc(50% + 1px);
    transform: translateY(-50%);
}

    .search-icon:before {
        font-size: 14px;
        color: #ABC;
    }

.search-hint {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    padding: 2px 6px;
    background: var(--border);
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-muted);
    cursor:pointer;
}
    .search-hint:hover {
        font-weight: bold;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    }

    

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 居中显示切换按钮 */
.center-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

    .center-toggle:hover {
        background: #fff;
        border-color: var(--primary);
        color: var(--primary);
    }

    .center-toggle.active {
        background: var(--primary-light);
        border-color: var(--primary);
        color: var(--primary);
    }

    .center-toggle svg {
        width: 16px;
        height: 16px;
        fill: currentColor;
    }

.btn-new {
    height: 36px;
    padding: 0 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .btn-new:hover {
        background: var(--primary-dark);
    }

    .btn-new svg {
        width: 16px;
        height: 16px;
        fill: currentColor;
    }

/* 主布局 */
.main-layout {
    display: flex;
    padding-top: 60px;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 20px 0;
}

.sidebar-section {
    border-bottom: 1px solid var(--border-light);
}


.sidebar-section.active > .sidebar-title {
        background: var(--primary-light);
        color: var(--primary);
        font-weight: bold;
    }


    .sidebar-title {
        padding: 8px 14px;
        font-size: 14px;
        font-weight: bolder;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        cursor: pointer;
    }

    .sidebar-title:hover {
        background: var(--border-light);
        color: var(--primary);
        font-weight:bold;
    }

    .sidebar-title:before {
        margin-right: 3px;
        opacity: 0.9;
    }

.sidebar-menu {
    list-style: none;
}


.sidebar-item {
    padding: 10px 23px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400 !important;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .sidebar-item:hover {
        background: var(--border-light);
        color: var(--text);
    }



    .sidebar-item.active {
        background: var(--primary-light);
        color: var(--primary);
        font-weight: 500;
    }

    .sidebar-item svg {
        width: 18px;
        height: 18px;
        fill: currentColor;
        flex-shrink: 0;
    }

.sidebar-item-count {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--border);
    padding: 2px 8px;
    border-radius: 10px;
}

/* 内容区 */
.content {
    flex: 1;
    margin-left: 260px;
    padding: 32px 48px;
    width: calc(100% - 300px);
    transition: max-width 0.3s ease, margin: 0.3s ease;
}

    /* 内容居中显示 */
    .content.centered {
        max-width: 720px;
        margin-left: auto;
        margin-right: auto;
    }

/* 侧边栏隐藏时内容居中 */
.main-layout.sidebar-hidden .content {
    margin-left: 0;
}

    .main-layout.sidebar-hidden .content.centered {
        max-width: 900px;
    }

/* 面包屑 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight:bolder;
    color: var(--text-muted);
    margin-bottom: 24px;
}

    .breadcrumb a {
        color: var(--text-secondary);
        text-decoration: none;
    }

        .breadcrumb a:hover {
            color: var(--primary);
        }

.breadcrumb-sep {
    color: var(--border);
}

/* 文章内容 */
.article {
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.article-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 16px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.article-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

    .article-meta-item svg {
        width: 14px;
        height: 14px;
        fill: currentColor;
    }

.article-tags {
    display: flex;
    gap: 8px;
}

.article-tag {
    padding: 4px 10px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 4px;
    font-size: 12px;
}

.article-body {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text);
}

    .article-body h2 {
        font-size: 20px;
        font-weight: 600;
        margin: 32px 0 16px;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--border-light);
    }

    .article-body h3 {
        font-size: 16px;
        font-weight: 600;
        margin: 24px 0 12px;
    }

    .article-body p {
        margin-bottom: 16px;
    }

    .article-body ul, .article-body ol {
        margin-bottom: 16px;
        padding-left: 24px;
    }

    .article-body li {
        margin-bottom: 8px;
    }

    .article-body code {
        font-family: "JetBrains Mono", monospace;
        font-size: 13px;
        background: var(--code-bg);
        padding: 2px 6px;
        border-radius: 4px;
        color: #e83e8c;
    }

    .article-body pre {
        background: #282c34;
        color: #abb2bf;
        padding: 20px;
        border-radius: var(--radius);
        overflow-x: auto;
        margin-bottom: 16px;
    }

        .article-body pre code {
            background: none;
            padding: 0;
            color: inherit;
        }

    .article-body blockquote {
        border-left: 4px solid var(--primary);
        padding-left: 16px;
        margin: 16px 0;
        color: var(--text-secondary);
        background: var(--bg-secondary);
        padding: 16px;
        border-radius: 0 var(--radius) var(--radius) 0;
    }

/* 文章操作 */
.article-actions {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
}

.article-footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.article-stats {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-like {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

    .btn-like:hover {
        border-color: #e83e8c;
        color: #e83e8c;
    }

    .btn-like.liked {
        background: #fff0f5;
        border-color: #e83e8c;
        color: #e83e8c;
    }

        .btn-like.liked svg {
            fill: #e83e8c;
        }

    .btn-like svg {
        width: 18px;
        height: 18px;
        fill: currentColor;
    }

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

    .btn-primary:hover {
        background: var(--primary-dark);
    }

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--border);
}

    .btn-secondary:hover {
        background: var(--border-light);
    }

.btn-danger {
    background: #fff;
    color: #dc3545;
    border: 1px solid #dc3545;
}

    .btn-danger:hover {
        background: #dc3545;
        color: white;
    }

.btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* 目录 */
.toc {
    position: fixed;
    top: 100px;
    right: 32px;
    width: 180px;
    padding: 16px;
    background: var(--bg-sidebar);
    border-radius: var(--radius);
    font-size: 13px;
}

.toc-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.toc-list {
    list-style: none;
}

.toc-item {
    padding: 6px 0;
}

    .toc-item a {
        color: var(--text-secondary);
        text-decoration: none;
        transition: color 0.15s ease;
    }

        .toc-item a:hover {
            color: var(--primary);
        }

    .toc-item.level-3 {
        padding-left: 12px;
    }



.doc-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.doc-card {
    padding: 24px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

    .doc-card:hover {
        border-color: var(--primary);
        box-shadow: 0 4px 16px rgba(0, 119, 255, 0.1);
        transform: translateY(-2px);
    }

.doc-card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .doc-card-title svg {
        width: 18px;
        height: 18px;
        fill: var(--primary);
    }

.doc-card-excerpt {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight:bolder;
}

.doc-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.doc-card-tags {
    display: flex;
    gap: 6px;
}

.doc-card-tag {
    padding: 2px 8px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 4px;
    font-size: 11px;
}

.doc-card-stats {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

    .doc-card-stats span {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .doc-card-stats svg {
        fill: currentColor;
    }

/* 编辑页 */
.edit-form {
    max-width: 800px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text);
}

    .form-label span {
        color: #dc3545;
    }

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    transition: all 0.2s ease;
}

    .form-input:focus,
    .form-textarea:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px var(--primary-light);
    }

.form-textarea {
    min-height: 400px;
    line-height: 1.8;
    resize: vertical;
}

.form-hint {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .empty-icon svg {
        width: 36px;
        height: 36px;
        fill: var(--text-muted);
    }

.empty-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-desc {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.doc-pagination {
    display:block;
    padding:8px;
    text-align:center;
    margin-top:12px;
}

.doc-p-inner {
    display:inline-block;
    margin:0px auto;
}

    .doc-p-inner > span, .doc-p-inner > a {
        display: inline-block;
        height: 25px;
        line-height: 25px;
        padding: 0px 10px;
        box-sizing: border-box;
        margin-left: 8px;
        font-weight:bolder;
    }

    .doc-p-inner > a, .doc-p-inner .btn {
        height: 25px;
        line-height: 25px;
        padding: 0px 10px;
        color: #729fb2;
        text-shadow: 0 1px rgba(255, 255, 255, 0.5);
        border: 1px solid #bed6e3;
        border-bottom-color: #accbd9;
        border-radius: 2px;
        background-color: #deeef4;
        background-image: linear-gradient(to bottom, #e6f2f7, #d0e6ee);
        cursor: pointer;
        user-select: none;
    }

        .doc-p-inner > a:hover {
            background-image: linear-gradient(to bottom, #d6f2f7, #c0e6ee);
            color: #527fa2;
        }

        .doc-p-inner > a.act {
            background-image: linear-gradient(to bottom, #F50, #F90);
        }

.empty-title:before {
    content: "暂无文档";
}

.empty-desc:before {
    content:"此类目暂无文章，请选点击左侧导航择别的类目";
}
/* 移动端 */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .content {
        margin-left: 0;
        padding: 24px 20px;
    }

    .search-box {
        display: none;
    }

    .doc-grid {
        grid-template-columns: 1fr;
    }

    .toc {
        display: none;
    }
}
