/* Doc Page — Google Search Central 风格文档中心 */
.dz-doc-layout {
    --dz-blue: #1a73e8;
    --dz-text: #202124;
    --dz-text2: #5f6368;
    --dz-border: #dadce0;
    --dz-active: #e8f0fe;
    --dz-side-w: 280px;
    --dz-top: 0px;
    display: flex;
    align-items: stretch;
    min-height: 100vh;
    background: #e8eaed;
    color: var(--dz-text);
    font-size: 15px;
    line-height: 1.6;
    position: relative;
}
.dz-doc-layout * { box-sizing: border-box; }
.dz-doc-layout a { color: var(--dz-blue); text-decoration: none; }
.dz-doc-layout a:hover { text-decoration: underline; }

/* ===================== 左侧目录 ===================== */
.dz-doc-sidebar {
    width: var(--dz-side-w);
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid var(--dz-border);
    box-shadow: 2px 0 6px rgba(0,0,0,.08);
    position: sticky;
    top: var(--dz-top);
    align-self: flex-start;
    height: 100vh;
    overflow: hidden;
    transition: width .25s ease, border .25s ease, box-shadow .25s ease;
}
.dz-doc-sidebar-inner {
    padding: 16px 0 64px;
    height: 100%;
    overflow-y: auto;
    width: var(--dz-side-w);
}
.dz-doc-nav, .dz-doc-sub { list-style: none; margin: 0; padding: 0; }
/* 顶级分类分割线 */
.dz-doc-nav > .dz-doc-navitem { border-bottom: 1px solid #ececec; }
.dz-doc-nav > .dz-doc-navitem:last-child { border-bottom: none; }
.dz-doc-navitem > a,
.dz-doc-navitem > .dz-doc-navtoggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 24px;
    color: var(--dz-text2);
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    line-height: 1.5;
}
.dz-doc-navitem > a:hover,
.dz-doc-navitem > .dz-doc-navtoggle:hover { background: #f1f3f4; text-decoration: none; }
.dz-doc-section > .dz-doc-navtoggle { color: var(--dz-text); font-weight: 500; }
.dz-doc-navtoggle.dz-doc-haslink { padding: 0; }
.dz-doc-navtoggle.dz-doc-haslink .dz-doc-sectitle-link {
    flex: 1 1 auto;
    padding: 7px 0 7px 24px;
    color: var(--dz-text);
    font-weight: 500;
}
.dz-doc-navtoggle.dz-doc-haslink .dz-doc-chevron { padding: 7px 24px 7px 8px; }

.dz-doc-sub { display: none; }
.dz-doc-section.open > .dz-doc-sub { display: block; }
.dz-doc-sub .dz-doc-navitem > a { padding-left: 40px; }

/* 嵌套子分类（第二层可展开） */
.dz-doc-section-sub > .dz-doc-navtoggle { font-weight: 500; color: var(--dz-text); padding-left: 40px; }
.dz-doc-section-sub > .dz-doc-navtoggle.dz-doc-haslink { padding-left: 0; }
.dz-doc-section-sub > .dz-doc-navtoggle.dz-doc-haslink .dz-doc-sectitle-link { padding-left: 40px; }
.dz-doc-section-sub > .dz-doc-sub .dz-doc-navitem > a { padding-left: 56px; }
.dz-doc-subhead > span {
    display: block;
    padding: 8px 24px 4px 40px;
    font-size: 12px;
    font-weight: 600;
    color: var(--dz-text2);
    text-transform: none;
}

.dz-doc-navlink.active {
    color: var(--dz-blue);
    background: var(--dz-active);
    font-weight: 500;
    border-right: 3px solid var(--dz-blue);
}
.dz-doc-navlink.active:hover { background: var(--dz-active); }
.dz-doc-sectitle-link.active { color: var(--dz-blue); }

.dz-doc-chevron {
    transition: transform .2s ease;
    width: 16px;
    height: 16px;
    line-height: 1;
    color: var(--dz-text2);
    flex-shrink: 0;
}
.dz-doc-section.open > .dz-doc-navtoggle .dz-doc-chevron { transform: rotate(180deg); }

/* 收起按钮 */
.dz-doc-collapse-btn {
    position: fixed;
    bottom: 16px;
    left: calc(var(--dz-side-w) - 46px);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--dz-border);
    background: #fff;
    color: var(--dz-text2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
    transition: left .25s ease;
    z-index: 50;
}
.dz-doc-collapse-btn:hover { background: #f1f3f4; }
.dz-doc-collapse-btn svg { transition: transform .25s ease; }

/* 收起状态 */
.dz-doc-layout.is-collapsed .dz-doc-sidebar { width: 0; border: none; box-shadow: none; }
.dz-doc-layout.is-collapsed .dz-doc-collapse-btn { left: 12px; }
.dz-doc-layout.is-collapsed .dz-doc-collapse-btn svg { transform: rotate(180deg); }
.dz-doc-layout.is-collapsed .dz-doc-content { max-width: 1340px; margin-left: auto; margin-right: auto; }
.dz-doc-layout.is-collapsed .dz-doc-shell { max-width: 100%; }

/* ===================== 内容区 ===================== */
.dz-doc-content {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
    padding: 32px 40px 48px;
    margin: 16px;
    background: #fff;
    border: 1px solid var(--dz-border);
}
.dz-doc-shell { display: flex; width: 100%; max-width: 1140px; }
.dz-doc-article { flex: 1; min-width: 0; }

/* 顶部行 */
.dz-doc-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}
.dz-doc-breadcrumb {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--dz-text2);
    margin-bottom: 16px; flex-wrap: wrap;
}
.dz-doc-breadcrumb .sep { color: var(--dz-text2); }
.dz-doc-crumb-current { color: var(--dz-text); }

.dz-doc-feedback { display: flex; align-items: center; gap: 10px; flex-shrink: 0; font-size: 13px; color: var(--dz-text2); }
.dz-doc-thumbs { display: flex; gap: 6px; align-items: center; }
.dz-doc-thumb {
    border: none; background: none; cursor: pointer; color: var(--dz-text2);
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.dz-doc-thumb:hover { background: #f1f3f4; }
.dz-doc-thumb.is-active { color: var(--dz-blue); background: var(--dz-active); }
.dz-doc-btn-feedback {
    border: 1px solid var(--dz-border); background: #fff; color: var(--dz-blue);
    border-radius: 4px; padding: 8px 20px; font-size: 14px; font-weight: 500;
    cursor: pointer; white-space: nowrap;
}
.dz-doc-btn-feedback:hover { background: #f8fbff; text-decoration: none; }

/* 标题 */
.dz-doc-title {
    font-weight: 400;
    font-size: 34px;
    line-height: 1.25;
    margin: 4px 0 24px;
    color: var(--dz-text);
}
.dz-doc-thumb-img { margin: 0 0 24px; }
.dz-doc-thumb-img img { max-width: 100%; height: auto; border-radius: 8px; }

/* 本页内容 TOC */
.dz-doc-toc { position: relative; margin: 0 0 32px; }
.dz-doc-toc-title {
    font-size: 14px; font-weight: 500; color: var(--dz-text);
    margin-bottom: 8px; cursor: pointer; display: inline-block; user-select: none;
}
.dz-doc-toc-title:hover { color: var(--dz-blue); }
.dz-doc-toc-list {
    list-style: none; margin: 0; padding: 0;
    overflow: hidden; transition: max-height .3s ease;
}
.dz-doc-toc.collapsed .dz-doc-toc-list {
    max-height: 132px;
    -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
}
.dz-doc-toc li { margin: 0; }
.dz-doc-toc li a {
    display: block;
    padding: 3px 0 3px 12px;
    font-size: 13px;
    color: var(--dz-blue);
    border-left: 2px solid transparent;
    line-height: 1.5;
}
.dz-doc-toc li a:hover { text-decoration: underline; }
.dz-doc-toc li a.active { font-weight: 500; border-left-color: var(--dz-blue); }
.dz-doc-toc ul ul { list-style: none; margin: 0; padding: 0; }
.dz-doc-toc ul ul li a { padding-left: 28px; }
.dz-doc-toc-more {
    display: flex; align-items: center; justify-content: flex-start;
    border: none; background: none; cursor: pointer;
    color: var(--dz-text2); padding: 2px 0; margin-top: 2px;
}
.dz-doc-toc-more:hover { color: var(--dz-text); }
.dz-doc-toc-chev { transition: transform .2s ease; }
.dz-doc-toc:not(.collapsed) .dz-doc-toc-chev { transform: rotate(180deg); }

/* 正文 */
.dz-doc-body { font-size: 15px; line-height: 1.7; color: var(--dz-text); }
.dz-doc-body p { margin: 0 0 16px; }
.dz-doc-body h2 { font-weight: 400; font-size: 26px; margin: 40px 0 16px; padding-top: 8px; line-height: 1.3; scroll-margin-top: calc(var(--dz-top) + 20px); }
.dz-doc-body h3 { font-weight: 400; font-size: 20px; margin: 28px 0 12px; line-height: 1.3; scroll-margin-top: calc(var(--dz-top) + 20px); }
.dz-doc-body h4 { font-size: 16px; font-weight: 500; margin: 20px 0 8px; }
.dz-doc-body ul, .dz-doc-body ol { margin: 0 0 16px; padding-left: 24px; }
.dz-doc-body li { margin-bottom: 10px; }
.dz-doc-body a { color: var(--dz-blue); }
.dz-doc-body img { max-width: 100%; height: auto; }
.dz-doc-body code {
    background: #f1f3f4; border-radius: 3px; padding: 2px 5px;
    font-family: "Roboto Mono", monospace; font-size: 13px; color: #37474f;
}
.dz-doc-body pre { background: #f1f3f4; border-radius: 6px; padding: 14px 16px; overflow: auto; }
.dz-doc-body blockquote { margin: 0 0 16px; padding: 8px 16px; border-left: 4px solid var(--dz-border); color: var(--dz-text2); }
.dz-doc-body table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.dz-doc-body th, .dz-doc-body td { border: 1px solid var(--dz-border); padding: 8px 12px; text-align: left; }

/* 上/下一篇 */
.dz-doc-prevnext {
    display: flex;
    gap: 16px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--dz-border);
}
.dz-doc-prevnext > span { flex: 1 1 0; }
.dz-doc-pn {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 20px;
    border: 1px solid var(--dz-border);
    border-radius: 12px;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.dz-doc-pn:hover {
    border-color: var(--dz-blue);
    background: #f8fbff;
    box-shadow: 0 2px 10px rgba(26,115,232,.12);
    text-decoration: none;
}
.dz-doc-layout a.dz-doc-pn:hover,
.dz-doc-layout a.dz-doc-pn:hover .dz-doc-pn-title,
.dz-doc-layout a.dz-doc-pn:hover .dz-doc-pn-label { text-decoration: none; }
.dz-doc-pn-next { text-align: right; align-items: flex-end; }
.dz-doc-pn-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--dz-text2);
}
.dz-doc-pn-prev .dz-doc-pn-label::before { content: "\2190"; font-size: 14px; }
.dz-doc-pn-next .dz-doc-pn-label::after  { content: "\2192"; font-size: 14px; }
.dz-doc-pn-title {
    font-size: 16px;
    color: var(--dz-blue);
    font-weight: 500;
    line-height: 1.4;
}
@media (max-width: 640px) {
    .dz-doc-prevnext { flex-direction: column; }
}

.dz-doc-empty { color: #80868b; font-size: 14px; padding: 16px; }

/* ===================== 响应式 ===================== */
@media (max-width: 900px) {
    .dz-doc-shell { max-width: 100% !important; }
}
@media (max-width: 640px) {
    .dz-doc-layout { display: block; }
    .dz-doc-sidebar {
        position: relative; top: 0; height: auto; width: 100%;
        border-right: none; border-bottom: 1px solid var(--dz-border); box-shadow: none;
    }
    .dz-doc-sidebar-inner { width: 100%; max-height: 60vh; }
    .dz-doc-collapse-btn { display: none; }
    .dz-doc-content { padding: 16px; margin: 8px; }
    .dz-doc-title { font-size: 26px; }
    .dz-doc-topbar { flex-direction: column; }
}
