/* 设计文档门户 */

.ued-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) 1fr;
    gap: 0;
    min-height: 60vh;
    max-width: 1400px;
    margin: 0 auto;
}

.ued-sidebar {
    border-right: 1px solid var(--border-color, #e5e7eb);
    padding: 1rem;
    background: var(--card-background, #fafafa);
    overflow: auto;
    max-height: calc(100vh - 120px);
    position: sticky;
    top: 0;
}

.ued-sidebar-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.ued-print-link {
    font-size: 0.8rem;
    font-weight: 400;
}

.ued-tree {
    list-style: none;
    padding-left: 0.75rem;
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.ued-sidebar > .ued-tree {
    padding-left: 0;
}

.ued-tree a {
    color: var(--text-primary, #222);
    text-decoration: none;
}

.ued-tree a:hover {
    color: var(--primary-color, #0d6efd);
    text-decoration: underline;
}

.ued-tree li.active > a {
    font-weight: 600;
    color: var(--primary-color, #0d6efd);
}

.ued-tree-dir > a {
    color: var(--text-secondary, #555);
}

.ued-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    background: #eef2ff;
    color: #3730a3;
    margin-left: 0.35rem;
    vertical-align: middle;
}

.ued-main {
    padding: 1rem 1.5rem 3rem;
    min-width: 0;
}

.ued-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ued-toolbar h1 {
    font-size: 1.5rem;
    margin: 0;
}

.ued-pager {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    font-size: 0.9rem;
}

.ued-pager-bottom {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.ued-article-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.ued-article-header h1,
.ued-article-header h2 {
    margin: 0;
}

.ued-content {
    line-height: 1.65;
}

.ued-content h1 { font-size: 1.75rem; margin-top: 1.5rem; }
.ued-content h2 { font-size: 1.4rem; margin-top: 1.35rem; border-bottom: 1px solid #eee; padding-bottom: 0.25rem; }
.ued-content h3 { font-size: 1.2rem; margin-top: 1.2rem; }
.ued-content h4, .ued-content h5, .ued-content h6 { font-size: 1.05rem; margin-top: 1rem; }

.ued-content pre {
    background: #f6f8fa;
    padding: 0.75rem 1rem;
    overflow: auto;
    border-radius: 4px;
}

.ued-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
}

.ued-content table {
    width: 100%;
    margin: 1rem 0;
}

.ued-content blockquote {
    border-left: 3px solid #cbd5e1;
    margin: 1rem 0;
    padding: 0.25rem 0 0.25rem 1rem;
    color: #475569;
}

.ued-content a.link-broken {
    color: #b91c1c;
    text-decoration: underline wavy;
}

.ued-dir-list {
    list-style: none;
    padding: 0;
}

.ued-dir-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

/* 打印聚合 */
.ued-print-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
}

.ued-print-cover {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #222;
}

.ued-print-toc {
    margin-bottom: 2rem;
}

.ued-print-section {
    margin-top: 2rem;
    padding-top: 1rem;
}

.ued-print-section-header h1 {
    font-size: 1.6rem;
}

.ued-print-section-meta {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1rem;
}

@media (max-width: 900px) {
    .ued-layout {
        grid-template-columns: 1fr;
    }
    .ued-sidebar {
        position: static;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border-color, #e5e7eb);
    }
}

@media print {
    .no-print,
    .header,
    .nav,
    .footer,
    .anonymous-warning,
    .ued-sidebar,
    .ued-toolbar,
    .ued-breadcrumb,
    .ued-pager {
        display: none !important;
    }

    .ued-layout {
        display: block;
    }

    .ued-main {
        padding: 0;
    }

    .ued-print-section {
        break-before: page;
    }

    .ued-print-cover,
    .ued-print-toc {
        break-after: page;
    }

    a[href]::after {
        content: none !important;
    }
}
