/* 文档长文骨架：顶栏 + 正文列 + 右侧目录。配色改为深青，底色略偏绿灰。 */
:root {
    --bg: #f4f8f6;
    --paper: #ffffff;
    --ink: #243038;
    --muted: rgba(36, 48, 56, 0.72);
    --line: #d3e0db;
    --soft: #e7f3f0;
    --brand: #0d6e62;
    --brand-deep: #0a574e;
    --header-h: 64px;
    --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.7;
}
a { color: var(--brand); }
img { max-width: 100%; height: auto; }
.skip {
    position: absolute;
    left: 12px;
    top: -40px;
    background: var(--brand);
    color: #fff;
    padding: 6px 10px;
    z-index: 50;
}
.skip:focus { top: 8px; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--header-h);
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}
.topbar-inner {
    height: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    white-space: nowrap;
}
.brand img { width: 28px; height: 28px; display: block; }
.search-btn {
    height: 40px;
    border: 0;
    background: #e7f1ee;
    border-radius: 10px;
    padding: 0 10px 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}
.search-btn kbd {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 12px;
    color: var(--ink);
}
.menu {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 18px;
}
.menu a {
    color: var(--ink);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.menu a.active { color: var(--brand); }
.nav-toggle {
    display: none;
    margin-left: auto;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    height: 36px;
    padding: 0 12px;
    font-family: inherit;
    cursor: pointer;
}
.nav-panel {
    display: none;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 8px 32px 16px;
}
.nav-panel a {
    display: block;
    padding: 8px 0;
    color: var(--ink);
    text-decoration: none;
    font-weight: 500;
}
.nav-panel.open { display: block; }

.doc-shell {
    width: min(1360px, calc(100% - 48px));
    margin: 0 auto;
    padding: 40px 0 0;
    display: grid;
    grid-template-columns: minmax(0, 784px) 224px;
    column-gap: 64px;
    justify-content: center;
    align-items: start;
}
.aside {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 110px);
    overflow: auto;
    padding-bottom: 32px;
}
.aside h2 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
}
.aside a {
    display: block;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.45;
    padding: 4px 0 4px 12px;
    border-left: 1px solid var(--line);
}
.aside a.sub { padding-left: 24px; font-size: 13px; }
.aside a.active {
    color: var(--brand);
    border-left-color: var(--brand);
    font-weight: 600;
}
.toc-mobile { display: none; }

.crumbs {
    border-left: 2px solid var(--brand);
    padding-left: 12px;
    font-size: 14px;
    font-weight: 700;
    line-height: 24px;
}
.crumbs a { color: var(--brand); text-decoration: none; }
.crumbs .sep { color: var(--muted); font-weight: 500; margin: 0 4px; }
.crumbs .now { color: var(--ink); }

h1 {
    margin: 18px 0 8px;
    font-size: 28px;
    line-height: 42px;
    font-weight: 600;
}
.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 22px;
}
.tag {
    font-size: 12px;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 3px;
    text-decoration: none;
}
.tag.a { background: rgba(13, 110, 98, 0.14); color: #0d6e62; }
.tag.b { background: rgba(37, 84, 138, 0.14); color: #25548a; }
.tag.c { background: rgba(122, 90, 40, 0.14); color: #7a5a28; }

.prose p { margin: 0 0 16px; line-height: 28px; }
.prose h2 {
    font-size: 24px;
    line-height: 1.35;
    font-weight: 600;
    margin: 48px 0 16px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}
.prose h2.first {
    border-top: 0;
    padding-top: 8px;
    margin-top: 28px;
}
.prose h3 { font-size: 20px; font-weight: 600; margin: 28px 0 12px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin: 6px 0; line-height: 28px; }
.prose strong { font-weight: 600; }
.path { margin: 0 0 12px; }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 16px;
    font-size: 14px;
    background: var(--paper);
}
th, td {
    border: 1px solid var(--line);
    padding: 8px 16px;
    text-align: left;
    vertical-align: top;
}
th {
    background: var(--soft);
    color: var(--muted);
    font-weight: 600;
}

.card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 0 0 16px;
}
.link-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 20px;
    background: var(--paper);
    box-shadow: 0 1px 2px rgba(13, 60, 52, 0.05);
    color: inherit;
    text-decoration: none;
}
.card-top { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.card-top img { width: 32px; height: 32px; }
.card-desc { color: var(--ink); line-height: 1.6; font-size: 15px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}
.btn:hover { background: var(--brand-deep); color: #fff; }
.btn.ghost {
    background: #fff;
    color: var(--brand);
    border: 1px solid var(--brand);
}
.btn.ghost:hover { background: var(--soft); }

figure { margin: 16px 0 20px; text-align: center; }
figure img {
    width: 300px;
    max-width: 100%;
    display: inline-block;
    background: #fff;
}
figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }

.related-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.related-grid a {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    background: var(--paper);
    color: inherit;
    text-decoration: none;
    min-height: 77px;
}
.related-grid strong { font-size: 16px; font-weight: 600; }
.related-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: 12px; }

.updated { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 18px 0 36px;
}
.pager a {
    display: block;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 16px 13px;
    background: var(--paper);
    text-decoration: none;
    color: var(--brand);
    font-weight: 500;
}
.pager small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; margin-bottom: 4px; }
.pager .next { text-align: right; }

.site-foot {
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 24px 16px 32px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}
.site-foot a { color: var(--brand); text-decoration: none; }
.site-foot p { margin: 0 0 6px; }

.to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(20, 40, 36, 0.08);
}

.search-pop {
    position: fixed;
    inset: 0;
    background: rgba(20, 36, 32, 0.28);
    z-index: 40;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
}
.search-pop.open { display: flex; }
.search-box {
    width: min(560px, calc(100% - 32px));
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--line);
    padding: 12px;
    box-shadow: 0 12px 40px rgba(20, 40, 36, 0.12);
}
.search-box input {
    width: 100%;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    font: inherit;
}
.search-box ul { list-style: none; margin: 8px 0 0; padding: 0; max-height: 320px; overflow: auto; }
.search-box li a {
    display: block;
    padding: 8px 10px;
    color: var(--ink);
    text-decoration: none;
    border-radius: 6px;
}
.search-box li a:hover { background: var(--soft); }

@media (max-width: 1100px) {
    .menu { display: none; }
    .nav-toggle { display: inline-flex; align-items: center; }
    .doc-shell {
        grid-template-columns: 1fr;
        width: min(784px, calc(100% - 32px));
        padding-top: 20px;
    }
    .aside { display: none; }
    .toc-mobile { display: block; margin-bottom: 16px; }
    .toc-mobile > button {
        width: 100%;
        text-align: left;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 10px 12px;
        font: inherit;
        cursor: pointer;
    }
    .toc-mobile nav { display: none; padding: 8px 4px 0; }
    .toc-mobile.open nav { display: block; }
    .toc-mobile nav a {
        display: block;
        padding: 6px 8px;
        color: var(--muted);
        text-decoration: none;
        font-size: 14px;
    }
    .card-grid, .related-grid, .pager { grid-template-columns: 1fr; }
    .pager .next { text-align: left; }
}
